/*
               File: Producto
        Description: Producto
             Author: GeneXus C# Generator version 10_2_4-75733
       Generated on: 7/17/2014 22:15:21.78
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class producto : GXDataArea, System.Web.SessionState.IRequiresSessionState
   {
      protected void INITENV( )
      {
         if ( GxWebError != 0 )
         {
            return  ;
         }
      }

      protected void INITTRN( )
      {
         initialize_properties( ) ;
         entryPointCalled = false;
         gxfirstwebparm = GetNextPar( );
         gxfirstwebparm_bkp = gxfirstwebparm;
         gxfirstwebparm = DecryptAjaxCall( gxfirstwebparm);
         if ( StringUtil.StrCmp(gxfirstwebparm, "dyncall") == 0 )
         {
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            dyncall( GetNextPar( )) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_4") == 0 )
         {
            A16ProductoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_4( A16ProductoId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_6") == 0 )
         {
            A24IngredienteId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_6( A24IngredienteId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxEvt") == 0 )
         {
            setAjaxEventMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = GetNextPar( );
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxNewRow_"+"Gridproducto_ingrediente") == 0 )
         {
            nRC_Gridproducto_ingrediente = (short)(NumberUtil.Val( GetNextPar( ), "."));
            nGXsfl_71_idx = (short)(NumberUtil.Val( GetNextPar( ), "."));
            sGXsfl_71_idx = GetNextPar( );
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxnrGridproducto_ingrediente_newrow( nRC_Gridproducto_ingrediente, nGXsfl_71_idx, sGXsfl_71_idx) ;
            return  ;
         }
         else
         {
            if ( ! IsValidAjaxCall( false) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = gxfirstwebparm_bkp;
         }
         if ( String.IsNullOrEmpty(StringUtil.RTrim( context.GetCookie( "GX_SESSION_ID"))) )
         {
            gxcookieaux = context.SetCookie( "GX_SESSION_ID", Crypto.Encrypt64( Crypto.GetEncryptionKey( ), Crypto.GetServerKey( )), "", (DateTime)(DateTime.MinValue), "", 0);
         }
         GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
         Form.Meta.addItem("generator", "GeneXus C# 10_2_4-75733", 0) ;
         Form.Meta.addItem("description", "Producto", 0) ;
         context.wjLoc = "";
         context.nUserReturn = 0;
         context.wbHandled = 0;
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
         }
         GX_FocusControl = edtProductoId_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         wbErr = false;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public producto( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default");
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public producto( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default");
      }

      public void release( )
      {
      }

      public void execute( )
      {
         executePrivate();
      }

      void executePrivate( )
      {
         isStatic = false;
         webExecute();
      }

      protected override void createObjects( )
      {
      }

      public override void webExecute( )
      {
         if ( initialized == 0 )
         {
            createObjects();
            initialize();
         }
         INITENV( ) ;
         INITTRN( ) ;
         if ( ( GxWebError == 0 ) && ! isAjaxCallMode( ) )
         {
            MasterPageObj = (GXMasterPage) ClassLoader.GetInstance("appmasterpage", "GeneXus.Programs.appmasterpage", new Object[] {new GxContext( context.handle, context.DataStores, context.HttpContext)});
            MasterPageObj.setDataArea(this,false);
            MasterPageObj.webExecute();
            if ( ( GxWebError == 0 ) && context.isAjaxRequest( ) )
            {
               enableOutput();
               if ( ! context.isAjaxRequest( ) )
               {
                  context.GX_webresponse.AppendHeader("Cache-Control", "max-age=0");
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) )
               {
                  context.GX_webresponse.AddString((String)(context.getJSONResponse( )));
               }
               else
               {
                  if ( context.isAjaxRequest( ) )
                  {
                     disableOutput();
                  }
                  RenderHtmlHeaders( ) ;
                  context.Redirect( context.wjLoc );
                  context.DispatchAjaxCommands();
               }
            }
         }
         this.cleanup();
      }

      protected void Draw( )
      {
         if ( context.isAjaxRequest( ) )
         {
            disableOutput();
         }
         if ( ! GxWebStd.gx_redirect( context) )
         {
            disable_std_buttons( ) ;
            enableDisable( ) ;
            set_caption( ) ;
            /* Form start */
            wb_table1_2_034( true) ;
         }
         return  ;
      }

      protected void wb_table1_2_034e( bool wbgen )
      {
         if ( wbgen )
         {
         }
         /* Execute Exit event if defined. */
      }

      protected void wb_table1_2_034( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTablemain_Internalname, tblTablemain_Internalname, "", "TableBorder100x100", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table2_5_034( true) ;
         }
         return  ;
      }

      protected void wb_table2_5_034e( bool wbgen )
      {
         if ( wbgen )
         {
            /* Control Group */
            ClassString = "Group";
            StyleString = "";
            context.WriteHtmlText( "<fieldset id=\""+grpGroupdata_Internalname+"\""+" style=\"-moz-border-radius:3pt;\""+" class=\""+ClassString+"\">") ;
            context.WriteHtmlText( "<legend class=\""+ClassString+"Title"+"\">"+"Producto"+"</legend>") ;
            wb_table3_28_034( true) ;
         }
         return  ;
      }

      protected void wb_table3_28_034e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</fieldset>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table1_2_034e( true) ;
         }
         else
         {
            wb_table1_2_034e( false) ;
         }
      }

      protected void wb_table3_28_034( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable1_Internalname, tblTable1_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            ClassString = "ErrorViewer";
            StyleString = "";
            GxWebStd.gx_msg_list( context, "", context.GX_msglist.DisplayMode, StyleString, ClassString, "", "false");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table4_34_034( true) ;
         }
         return  ;
      }

      protected void wb_table4_34_034e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 83,'',false,'',0)\"";
            ClassString = "BtnEnter";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_enter_Internalname, "", "Confirmar", bttBtn_enter_Jsonclick, 5, "Confirmar", "", StyleString, ClassString, bttBtn_enter_Visible, 1, "standard", "EENTER.", TempTags, "", context.GetButtonType( ), "HLP_Producto.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 84,'',false,'',0)\"";
            ClassString = "BtnCancel";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_cancel_Internalname, "", "Cancelar", bttBtn_cancel_Jsonclick, 1, "Cancelar", "", StyleString, ClassString, bttBtn_cancel_Visible, 1, "standard", "ECANCEL.", TempTags, "", context.GetButtonType( ), "HLP_Producto.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 85,'',false,'',0)\"";
            ClassString = "BtnDelete";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_delete_Internalname, "", "Eliminar", bttBtn_delete_Jsonclick, 5, "Eliminar", "", StyleString, ClassString, bttBtn_delete_Visible, 1, "standard", "EDELETE.", TempTags, "", context.GetButtonType( ), "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table3_28_034e( true) ;
         }
         else
         {
            wb_table3_28_034e( false) ;
         }
      }

      protected void wb_table4_34_034( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable2_Internalname, tblTable2_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductoid_Internalname, "Id", "", "", lblTextblockproductoid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 39,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtProductoId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A16ProductoId), 10, 0, ",", "")), ((edtProductoId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A16ProductoId), "ZZZZZZZZZ9")) : context.localUtil.Format( (decimal)(A16ProductoId), "ZZZZZZZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(39);\"", "", "", "", "", "", edtProductoId_Jsonclick, 0, ClassString, StyleString, "", 1, edtProductoId_Enabled, 0, "text", "", 10, "chr", 1, "row", 10, 0, 0, 0, 1, -1, 0, true, "Id", "right", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductodescripcion_Internalname, "Descripcion", "", "", lblTextblockproductodescripcion_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Multiple line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 44,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_html_textarea( context, edtProductoDescripcion_Internalname, StringUtil.RTrim( A20ProductoDescripcion), "", TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(44);\"", 0, 1, edtProductoDescripcion_Enabled, 0, 80, "chr", 3, "row", StyleString, ClassString, "200", -1, "", "", -1, true, "Descripcion", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductoestado_Internalname, "Estado", "", "", lblTextblockproductoestado_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 49,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtProductoEstado_Internalname, StringUtil.RTrim( A21ProductoEstado), StringUtil.RTrim( context.localUtil.Format( A21ProductoEstado, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(49);\"", "", "", "", "", "", edtProductoEstado_Jsonclick, 0, ClassString, StyleString, "", 1, edtProductoEstado_Enabled, 0, "text", "", 1, "chr", 1, "row", 1, 0, 0, 0, 1, -1, -1, true, "Estado", "left", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductotipo_Internalname, "Tipo", "", "", lblTextblockproductotipo_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 54,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtProductoTipo_Internalname, StringUtil.RTrim( A23ProductoTipo), StringUtil.RTrim( context.localUtil.Format( A23ProductoTipo, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(54);\"", "", "", "", "", "", edtProductoTipo_Jsonclick, 0, ClassString, StyleString, "", 1, edtProductoTipo_Enabled, 0, "text", "", 1, "chr", 1, "row", 1, 0, 0, 0, 1, -1, -1, true, "", "left", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductoreceta_Internalname, "Receta", "", "", lblTextblockproductoreceta_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Multiple line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 59,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_html_textarea( context, edtProductoReceta_Internalname, StringUtil.RTrim( A51ProductoReceta), "", TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(59);\"", 0, 1, edtProductoReceta_Enabled, 0, 80, "chr", 4, "row", StyleString, ClassString, "255", -1, "", "", -1, true, "", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductotiempopreparacion_Internalname, "Tiempo Preparacion", "", "", lblTextblockproductotiempopreparacion_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 64,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtProductoTiempoPreparacion_Internalname, StringUtil.LTrim( StringUtil.NToC( A52ProductoTiempoPreparacion, 4, 2, ",", "")), ((edtProductoTiempoPreparacion_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A52ProductoTiempoPreparacion, "9.99")) : context.localUtil.Format( A52ProductoTiempoPreparacion, "9.99")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_decimal( this, '.',',','2');"+";gx.evt.onblur(64);\"", "", "", "", "", "", edtProductoTiempoPreparacion_Jsonclick, 0, ClassString, StyleString, "", 1, edtProductoTiempoPreparacion_Enabled, 0, "text", "", 4, "chr", 1, "row", 4, 0, 0, 0, 1, -1, 0, true, "", "right", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td colspan=\"2\" >") ;
            context.WriteHtmlText( "<br/>") ;
            wb_table5_67_034( true) ;
         }
         return  ;
      }

      protected void wb_table5_67_034e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "<hr class=\"HRDefault\"/>") ;
            /*  Grid Control  */
            Gridproducto_ingredienteContainer.AddObjectProperty("GridName", "Gridproducto_ingrediente");
            Gridproducto_ingredienteContainer.AddObjectProperty("Class", "Grid");
            Gridproducto_ingredienteContainer.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(1), 4, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Backcolorstyle", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Backcolorstyle), 1, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("CmpContext", "");
            Gridproducto_ingredienteContainer.AddObjectProperty("InMasterPage", "false");
            Gridproducto_ingredienteColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridproducto_ingredienteColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A24IngredienteId), 10, 0, ".", "")));
            Gridproducto_ingredienteColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteId_Enabled), 5, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddColumnProperties(Gridproducto_ingredienteColumn);
            Gridproducto_ingredienteColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridproducto_ingredienteContainer.AddColumnProperties(Gridproducto_ingredienteColumn);
            Gridproducto_ingredienteColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridproducto_ingredienteColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A25ProductoIngredienteCantidad), 3, 0, ".", "")));
            Gridproducto_ingredienteColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCantidad_Enabled), 5, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddColumnProperties(Gridproducto_ingredienteColumn);
            Gridproducto_ingredienteColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridproducto_ingredienteColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ".", "")));
            Gridproducto_ingredienteColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteCosto_Enabled), 5, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddColumnProperties(Gridproducto_ingredienteColumn);
            Gridproducto_ingredienteColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridproducto_ingredienteColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( A44ProductoIngredienteCosto, 5, 2, ".", "")));
            Gridproducto_ingredienteColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCosto_Enabled), 5, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddColumnProperties(Gridproducto_ingredienteColumn);
            Gridproducto_ingredienteContainer.AddObjectProperty("Allowselection", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Allowselection), 1, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Selectioncolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Selectioncolor), 9, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Allowhover", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Allowhovering), 1, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Hovercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Hoveringcolor), 9, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Allowcollapsing", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Allowcollapsing), 1, 0, ".", "")));
            Gridproducto_ingredienteContainer.AddObjectProperty("Collapsed", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridproducto_ingrediente_Collapsed), 1, 0, ".", "")));
            nGXsfl_71_idx = 0;
            if ( ( nKeyPressed == 1 ) && ( AnyError == 0 ) )
            {
               /* Enter key processing. */
               nBlankRcdCount7 = 5;
               if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
               {
                  /* Display confirmed (stored) records */
                  nRcdExists_7 = 1;
                  ScanStart037( ) ;
                  while ( RcdFound7 != 0 )
                  {
                     init_level_properties7( ) ;
                     getByPrimaryKey037( ) ;
                     AddRow037( ) ;
                     ScanNext037( ) ;
                  }
                  ScanEnd037( ) ;
                  nBlankRcdCount7 = 5;
               }
            }
            else if ( ( nKeyPressed == 3 ) || ( nKeyPressed == 4 ) || ( ( nKeyPressed == 1 ) && ( AnyError != 0 ) ) )
            {
               /* Button check  or addlines. */
               B22ProductoPrecio = A22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               standaloneNotModal037( ) ;
               standaloneModal037( ) ;
               sMode7 = Gx_mode;
               while ( nGXsfl_71_idx < nRC_Gridproducto_ingrediente )
               {
                  ReadRow037( ) ;
                  edtIngredienteId_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEID_"+sGXsfl_71_idx+"Enabled"), ",", "."));
                  edtProductoIngredienteCantidad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx+"Enabled"), ",", "."));
                  edtIngredienteCosto_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled"), ",", "."));
                  edtProductoIngredienteCosto_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled"), ",", "."));
                  imgprompt_24_Link = cgiGet( "PROMPT_24_"+sGXsfl_71_idx+"Link");
                  if ( ( nRcdExists_7 == 0 ) && ( StringUtil.StrCmp(Gx_mode, "INS") != 0 ) )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     standaloneModal037( ) ;
                  }
                  SendRow037( ) ;
               }
               Gx_mode = sMode7;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               A22ProductoPrecio = B22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            else
            {
               /* Get or get-alike key processing. */
               nBlankRcdCount7 = 5;
               nRcdExists_7 = 1;
               ScanStart037( ) ;
               while ( RcdFound7 != 0 )
               {
                  init_level_properties7( ) ;
                  standaloneNotModal037( ) ;
                  getByPrimaryKey037( ) ;
                  standaloneModal037( ) ;
                  AddRow037( ) ;
                  ScanNext037( ) ;
               }
               ScanEnd037( ) ;
            }
            /* Initialize fields for 'new' records and send them. */
            sMode7 = Gx_mode;
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            InitAll037( ) ;
            init_level_properties7( ) ;
            B22ProductoPrecio = A22ProductoPrecio;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            standaloneNotModal037( ) ;
            standaloneModal037( ) ;
            nRcdExists_7 = 0;
            nIsMod_7 = 0;
            nBlankRcdCount7 = (short)(nBlankRcdUsr7+nBlankRcdCount7);
            fRowAdded = 0;
            while ( nBlankRcdCount7 > 0 )
            {
               AddRow037( ) ;
               if ( ( nKeyPressed == 4 ) && ( fRowAdded == 0 ) )
               {
                  fRowAdded = 1;
                  GX_FocusControl = edtIngredienteId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               nBlankRcdCount7 = (short)(nBlankRcdCount7-1);
            }
            Gx_mode = sMode7;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            A22ProductoPrecio = B22ProductoPrecio;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            sStyleString = " style=\"display:none;\"";
            sStyleString = "";
            context.WriteHtmlText( "<div id=\""+"Gridproducto_ingredienteContainer"+"Div\" "+sStyleString+">"+"</div>") ;
            context.httpAjaxContext.ajax_rsp_assign_grid("_"+"Gridproducto_ingrediente", (Object)(Gridproducto_ingredienteContainer));
            if ( ! context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridproducto_ingredienteContainerData", Gridproducto_ingredienteContainer.ToJavascriptSource());
            }
            if ( context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridproducto_ingredienteContainerData"+"V", Gridproducto_ingredienteContainer.GridValuesHidden());
            }
            else
            {
               context.WriteHtmlText( "<input type=\"hidden\" "+"name=\""+"Gridproducto_ingredienteContainerData"+"V"+"\" value='"+Gridproducto_ingredienteContainer.GridValuesHidden()+"'/>") ;
            }
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockproductoprecio_Internalname, "Precio", "", "", lblTextblockproductoprecio_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtProductoPrecio_Internalname, StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ",", "")), ((edtProductoPrecio_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A22ProductoPrecio, "Z9.99")) : context.localUtil.Format( A22ProductoPrecio, "Z9.99")), "", "", "", "", "", "", edtProductoPrecio_Jsonclick, 0, ClassString, StyleString, "", 1, edtProductoPrecio_Enabled, 0, "text", "", 5, "chr", 1, "row", 5, 0, 0, 0, 1, -1, 0, true, "Precio", "right", "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table4_34_034e( true) ;
         }
         else
         {
            wb_table4_34_034e( false) ;
         }
      }

      protected void wb_table5_67_034( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable3_Internalname, tblTable3_Internalname, "", "Table95", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"SubTitle\" >") ;
            /* Text block */
            ClassString = "";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTitleingrediente_Internalname, "Ingrediente", "", "", lblTitleingrediente_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Producto.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table5_67_034e( true) ;
         }
         else
         {
            wb_table5_67_034e( false) ;
         }
      }

      protected void wb_table2_5_034( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTabletoolbar_Internalname, tblTabletoolbar_Internalname, "", "ViewTable", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            /* Div Control */
            ClassString = "ToolbarMain";
            StyleString = "";
            GxWebStd.gx_div_start( context, divSectiontoolbar_Internalname, 1, 0, "px", 0, "px", ClassString, "");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 9,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_Internalname, context.GetImagePath( "b9e06284-17ac-4c88-8937-5dbd84ad5d80", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_Visible, 1, "", "Primero", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 10,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_separator_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 11,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_Internalname, context.GetImagePath( "7d212604-db7b-4785-9c0d-5faffe71aa33", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_Visible, 1, "", "Anterior", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 12,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_separator_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 13,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_Internalname, context.GetImagePath( "1ae947cf-1354-41a9-8d59-d91daebf554f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_Visible, 1, "", "Siguiente", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 14,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_separator_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 15,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_Internalname, context.GetImagePath( "29211874-e613-48e5-9011-8017d984217e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_Visible, 1, "", "Ultimo", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 16,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_separator_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 17,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_Internalname, context.GetImagePath( "1ca03f75-9947-4d2c-90a4-e8ab9c5cedea", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_Visible, 1, "", "Seleccionar", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0040.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PRODUCTOID"+"'), id:'"+"PRODUCTOID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 18,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_separator_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0040.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PRODUCTOID"+"'), id:'"+"PRODUCTOID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 19,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_Internalname, context.GetImagePath( "2061cf2c-bd33-4433-a13e-34af954142e9", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_Visible, imgBtn_enter2_Enabled, "", "Confirmar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 20,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_separator_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 21,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_Internalname, context.GetImagePath( "0e94ced8-bc34-47ff-9a53-bc683736a686", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_Visible, 1, "", "Cancelar", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 22,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_separator_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 23,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_Internalname, context.GetImagePath( "7695fe89-52c9-4b7e-871e-0e11548f823e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_Visible, imgBtn_delete2_Enabled, "", "Eliminar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 24,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_separator_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Producto.htm");
            context.WriteHtmlText( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table2_5_034e( true) ;
         }
         else
         {
            wb_table2_5_034e( false) ;
         }
      }

      protected void UserMain( )
      {
         standaloneStartup( ) ;
      }

      protected void standaloneStartup( )
      {
         standaloneStartupServer( ) ;
         disable_std_buttons( ) ;
         enableDisable( ) ;
         Process( ) ;
      }

      protected void standaloneStartupServer( )
      {
         /* Execute Start event if defined. */
         context.wbGlbDoneStart = 0;
         context.wbGlbDoneStart = 1;
         assign_properties_default( ) ;
         if ( AnyError == 0 )
         {
            if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
            {
               /* Read saved SDTs. */
               /* Read variables values. */
               if ( ( ( context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PRODUCTOID");
                  AnyError = 1;
                  GX_FocusControl = edtProductoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A16ProductoId = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
               }
               else
               {
                  A16ProductoId = (long)(context.localUtil.CToN( cgiGet( edtProductoId_Internalname), ",", "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
               }
               A20ProductoDescripcion = cgiGet( edtProductoDescripcion_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProductoDescripcion", A20ProductoDescripcion);
               A21ProductoEstado = cgiGet( edtProductoEstado_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProductoEstado", A21ProductoEstado);
               A23ProductoTipo = cgiGet( edtProductoTipo_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A23ProductoTipo", A23ProductoTipo);
               A51ProductoReceta = cgiGet( edtProductoReceta_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A51ProductoReceta", A51ProductoReceta);
               if ( ( ( context.localUtil.CToN( cgiGet( edtProductoTiempoPreparacion_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtProductoTiempoPreparacion_Internalname), ",", ".") > 9.99m ) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PRODUCTOTIEMPOPREPARACION");
                  AnyError = 1;
                  GX_FocusControl = edtProductoTiempoPreparacion_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A52ProductoTiempoPreparacion = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.Str( A52ProductoTiempoPreparacion, 4, 2)));
               }
               else
               {
                  A52ProductoTiempoPreparacion = context.localUtil.CToN( cgiGet( edtProductoTiempoPreparacion_Internalname), ",", ".");
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.Str( A52ProductoTiempoPreparacion, 4, 2)));
               }
               A22ProductoPrecio = context.localUtil.CToN( cgiGet( edtProductoPrecio_Internalname), ",", ".");
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               /* Read saved values. */
               Z16ProductoId = (long)(context.localUtil.CToN( cgiGet( "Z16ProductoId"), ",", "."));
               Z20ProductoDescripcion = cgiGet( "Z20ProductoDescripcion");
               Z21ProductoEstado = cgiGet( "Z21ProductoEstado");
               Z23ProductoTipo = cgiGet( "Z23ProductoTipo");
               Z51ProductoReceta = cgiGet( "Z51ProductoReceta");
               Z52ProductoTiempoPreparacion = context.localUtil.CToN( cgiGet( "Z52ProductoTiempoPreparacion"), ",", ".");
               O22ProductoPrecio = context.localUtil.CToN( cgiGet( "O22ProductoPrecio"), ",", ".");
               IsConfirmed = (short)(context.localUtil.CToN( cgiGet( "IsConfirmed"), ",", "."));
               IsModified = (short)(context.localUtil.CToN( cgiGet( "IsModified"), ",", "."));
               Gx_mode = cgiGet( "Mode");
               nRC_Gridproducto_ingrediente = (short)(context.localUtil.CToN( cgiGet( "nRC_Gridproducto_ingrediente"), ",", "."));
               Gx_mode = cgiGet( "vMODE");
               /* Read subfile selected row values. */
               /* Read hidden variables. */
               GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
               /* Check if conditions changed and reset current page numbers */
               standaloneNotModal( ) ;
            }
            else
            {
               standaloneNotModal( ) ;
               if ( StringUtil.StrCmp(gxfirstwebparm, "viewer") == 0 )
               {
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  A16ProductoId = (long)(NumberUtil.Val( GetNextPar( ), "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
                  getEqualNoModal( ) ;
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  disable_std_buttons_dsp( ) ;
                  standaloneModal( ) ;
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  standaloneModal( ) ;
               }
            }
         }
      }

      protected void Process( )
      {
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            /* Read Transaction buttons. */
            sEvt = cgiGet( "_EventName");
            EvtGridId = cgiGet( "_EventGridId");
            EvtRowId = cgiGet( "_EventRowId");
            if ( StringUtil.Len( sEvt) > 0 )
            {
               sEvtType = StringUtil.Left( sEvt, 1);
               sEvt = StringUtil.Right( sEvt, (short)(StringUtil.Len( sEvt)-1));
               if ( StringUtil.StrCmp(sEvtType, "M") != 0 )
               {
                  if ( StringUtil.StrCmp(sEvtType, "E") == 0 )
                  {
                     sEvtType = StringUtil.Right( sEvt, 1);
                     if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                     {
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1));
                        if ( StringUtil.StrCmp(sEvt, "ENTER") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_enter( ) ;
                           /* No code required for Cancel button. It is implemented as the Reset button. */
                        }
                        else if ( StringUtil.StrCmp(sEvt, "FIRST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_first( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "PREVIOUS") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_previous( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "NEXT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_next( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LAST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_last( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "SELECT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_select( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "DELETE") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_delete( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                        {
                           context.wbHandled = 1;
                           AfterKeyLoadScreen( ) ;
                        }
                     }
                     else
                     {
                        sEvtType = StringUtil.Right( sEvt, 4);
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-4));
                     }
                  }
                  context.wbHandled = 1;
               }
            }
         }
      }

      protected void AfterTrn( )
      {
         if ( trnEnded == 1 )
         {
            trnEnded = 0;
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               /* Clear variables for new insertion. */
               InitAll034( ) ;
               standaloneNotModal( ) ;
               standaloneModal( ) ;
            }
         }
      }

      public override String ToString( )
      {
         return "" ;
      }

      public GxContentInfo GetContentInfo( )
      {
         return (GxContentInfo)(null) ;
      }

      protected void disable_std_buttons( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
      }

      protected void disable_std_buttons_dsp( )
      {
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         imgBtn_first_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_Visible), 5, 0)));
         imgBtn_first_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_separator_Visible), 5, 0)));
         imgBtn_previous_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_Visible), 5, 0)));
         imgBtn_previous_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_separator_Visible), 5, 0)));
         imgBtn_next_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_Visible), 5, 0)));
         imgBtn_next_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_separator_Visible), 5, 0)));
         imgBtn_last_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_Visible), 5, 0)));
         imgBtn_last_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_separator_Visible), 5, 0)));
         imgBtn_select_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_Visible), 5, 0)));
         imgBtn_select_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_separator_Visible), 5, 0)));
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Visible), 5, 0)));
            imgBtn_enter2_separator_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_separator_Visible), 5, 0)));
            bttBtn_enter_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_enter_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_enter_Visible), 5, 0)));
         }
         DisableAttributes034( ) ;
      }

      protected void set_caption( )
      {
         if ( ( IsConfirmed == 1 ) && ( AnyError == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_confdelete", ""), 0, "");
            }
            else
            {
               GX_msglist.addItem(context.GetMessage( "GXM_mustconfirm", ""), 0, "");
            }
         }
      }

      protected void CONFIRM_037( )
      {
         s22ProductoPrecio = O22ProductoPrecio;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         nGXsfl_71_idx = 0;
         while ( nGXsfl_71_idx < nRC_Gridproducto_ingrediente )
         {
            ReadRow037( ) ;
            if ( ( nRcdExists_7 != 0 ) || ( nIsMod_7 != 0 ) )
            {
               GetKey037( ) ;
               if ( ( nRcdExists_7 == 0 ) && ( nRcdDeleted_7 == 0 ) )
               {
                  if ( RcdFound7 == 0 )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     BeforeValidate037( ) ;
                     if ( AnyError == 0 )
                     {
                        CheckExtendedTable037( ) ;
                        CloseExtendedTableCursors037( ) ;
                        if ( AnyError == 0 )
                        {
                           IsConfirmed = 1;
                        }
                        O22ProductoPrecio = A22ProductoPrecio;
                        n22ProductoPrecio = false;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "INGREDIENTEID");
                     AnyError = 1;
                     GX_FocusControl = edtIngredienteId_Internalname;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
               else
               {
                  if ( RcdFound7 != 0 )
                  {
                     if ( nRcdDeleted_7 != 0 )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        getByPrimaryKey037( ) ;
                        Load037( ) ;
                        BeforeValidate037( ) ;
                        if ( AnyError == 0 )
                        {
                           OnDeleteControls037( ) ;
                           O22ProductoPrecio = A22ProductoPrecio;
                           n22ProductoPrecio = false;
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                        }
                     }
                     else
                     {
                        if ( nIsMod_7 != 0 )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           BeforeValidate037( ) ;
                           if ( AnyError == 0 )
                           {
                              CheckExtendedTable037( ) ;
                              CloseExtendedTableCursors037( ) ;
                              if ( AnyError == 0 )
                              {
                                 IsConfirmed = 1;
                              }
                              O22ProductoPrecio = A22ProductoPrecio;
                              n22ProductoPrecio = false;
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                           }
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_7 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "INGREDIENTEID");
                        AnyError = 1;
                        GX_FocusControl = edtIngredienteId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
            }
            ChangePostValue( edtIngredienteId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A24IngredienteId), 10, 0, ",", ""))) ;
            ChangePostValue( edtProductoIngredienteCantidad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A25ProductoIngredienteCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( edtIngredienteCosto_Internalname, StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( edtProductoIngredienteCosto_Internalname, StringUtil.LTrim( StringUtil.NToC( A44ProductoIngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z24IngredienteId_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z24IngredienteId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z25ProductoIngredienteCantidad_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z25ProductoIngredienteCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( "T44ProductoIngredienteCosto_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( O44ProductoIngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( "nRcdDeleted_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_7), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_7), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_7), 4, 0, ",", ""))) ;
            if ( nIsMod_7 != 0 )
            {
               ChangePostValue( "INGREDIENTEID_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCantidad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteCosto_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCosto_Enabled), 5, 0, ".", ""))) ;
            }
         }
         O22ProductoPrecio = s22ProductoPrecio;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         /* Start of After( level) rules */
         /* End of After( level) rules */
      }

      protected void ResetCaption030( )
      {
      }

      protected void ZM034( short GX_JID )
      {
         if ( ( GX_JID == 3 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z20ProductoDescripcion = T00036_A20ProductoDescripcion[0];
               Z21ProductoEstado = T00036_A21ProductoEstado[0];
               Z23ProductoTipo = T00036_A23ProductoTipo[0];
               Z51ProductoReceta = T00036_A51ProductoReceta[0];
               Z52ProductoTiempoPreparacion = T00036_A52ProductoTiempoPreparacion[0];
            }
            else
            {
               Z20ProductoDescripcion = A20ProductoDescripcion;
               Z21ProductoEstado = A21ProductoEstado;
               Z23ProductoTipo = A23ProductoTipo;
               Z51ProductoReceta = A51ProductoReceta;
               Z52ProductoTiempoPreparacion = A52ProductoTiempoPreparacion;
            }
         }
         if ( GX_JID == -3 )
         {
            Z16ProductoId = A16ProductoId;
            Z20ProductoDescripcion = A20ProductoDescripcion;
            Z21ProductoEstado = A21ProductoEstado;
            Z23ProductoTipo = A23ProductoTipo;
            Z51ProductoReceta = A51ProductoReceta;
            Z52ProductoTiempoPreparacion = A52ProductoTiempoPreparacion;
            Z22ProductoPrecio = A22ProductoPrecio;
         }
      }

      protected void standaloneNotModal( )
      {
      }

      protected void standaloneModal( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_delete2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_enter2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
      }

      protected void Load034( )
      {
         /* Using cursor T000310 */
         pr_default.execute(6, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(6) != 101) )
         {
            RcdFound4 = 1;
            A20ProductoDescripcion = T000310_A20ProductoDescripcion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProductoDescripcion", A20ProductoDescripcion);
            A21ProductoEstado = T000310_A21ProductoEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProductoEstado", A21ProductoEstado);
            A23ProductoTipo = T000310_A23ProductoTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A23ProductoTipo", A23ProductoTipo);
            A51ProductoReceta = T000310_A51ProductoReceta[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A51ProductoReceta", A51ProductoReceta);
            A52ProductoTiempoPreparacion = T000310_A52ProductoTiempoPreparacion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.Str( A52ProductoTiempoPreparacion, 4, 2)));
            A22ProductoPrecio = T000310_A22ProductoPrecio[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            n22ProductoPrecio = T000310_n22ProductoPrecio[0];
            ZM034( -3) ;
         }
         pr_default.close(6);
         OnLoadActions034( ) ;
      }

      protected void OnLoadActions034( )
      {
         O22ProductoPrecio = A22ProductoPrecio;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
      }

      protected void CheckExtendedTable034( )
      {
         Gx_BScreen = 1;
         standaloneModal( ) ;
         /* Using cursor T00038 */
         pr_default.execute(5, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(5) != 101) )
         {
            A22ProductoPrecio = T00038_A22ProductoPrecio[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            n22ProductoPrecio = T00038_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         pr_default.close(5);
      }

      protected void CloseExtendedTableCursors034( )
      {
         pr_default.close(5);
      }

      protected void enableDisable( )
      {
      }

      protected void gxLoad_4( long A16ProductoId )
      {
         /* Using cursor T000312 */
         pr_default.execute(7, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(7) != 101) )
         {
            A22ProductoPrecio = T000312_A22ProductoPrecio[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            n22ProductoPrecio = T000312_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("\""+GXUtil.EncodeJSConstant( StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", "")))+"\"");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(7) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(7);
      }

      protected void GetKey034( )
      {
         /* Using cursor T000313 */
         pr_default.execute(8, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(8) != 101) )
         {
            RcdFound4 = 1;
         }
         else
         {
            RcdFound4 = 0;
         }
         pr_default.close(8);
      }

      protected void getByPrimaryKey( )
      {
         /* Using cursor T00036 */
         pr_default.execute(4, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(4) != 101) )
         {
            ZM034( 3) ;
            RcdFound4 = 1;
            A16ProductoId = T00036_A16ProductoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
            A20ProductoDescripcion = T00036_A20ProductoDescripcion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProductoDescripcion", A20ProductoDescripcion);
            A21ProductoEstado = T00036_A21ProductoEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProductoEstado", A21ProductoEstado);
            A23ProductoTipo = T00036_A23ProductoTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A23ProductoTipo", A23ProductoTipo);
            A51ProductoReceta = T00036_A51ProductoReceta[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A51ProductoReceta", A51ProductoReceta);
            A52ProductoTiempoPreparacion = T00036_A52ProductoTiempoPreparacion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.Str( A52ProductoTiempoPreparacion, 4, 2)));
            Z16ProductoId = A16ProductoId;
            sMode4 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Load034( ) ;
            if ( AnyError == 1 )
            {
               RcdFound4 = 0;
               InitializeNonKey034( ) ;
            }
            Gx_mode = sMode4;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound4 = 0;
            InitializeNonKey034( ) ;
            sMode4 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Gx_mode = sMode4;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         pr_default.close(4);
      }

      protected void getEqualNoModal( )
      {
         GetKey034( ) ;
         if ( RcdFound4 == 0 )
         {
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         getByPrimaryKey( ) ;
      }

      protected void move_next( )
      {
         RcdFound4 = 0;
         /* Using cursor T000314 */
         pr_default.execute(9, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(9) != 101) )
         {
            while ( (pr_default.getStatus(9) != 101) && ( ( T000314_A16ProductoId[0] < A16ProductoId ) ) )
            {
               pr_default.readNext(9);
            }
            if ( (pr_default.getStatus(9) != 101) && ( ( T000314_A16ProductoId[0] > A16ProductoId ) ) )
            {
               A16ProductoId = T000314_A16ProductoId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
               RcdFound4 = 1;
            }
         }
         pr_default.close(4);
      }

      protected void move_previous( )
      {
         RcdFound4 = 0;
         /* Using cursor T000315 */
         pr_default.execute(10, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(10) != 101) )
         {
            while ( (pr_default.getStatus(10) != 101) && ( ( T000315_A16ProductoId[0] > A16ProductoId ) ) )
            {
               pr_default.readNext(10);
            }
            if ( (pr_default.getStatus(10) != 101) && ( ( T000315_A16ProductoId[0] < A16ProductoId ) ) )
            {
               A16ProductoId = T000315_A16ProductoId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
               RcdFound4 = 1;
            }
         }
         pr_default.close(3);
      }

      protected void btn_enter( )
      {
         nKeyPressed = 1;
         GetKey034( ) ;
         if ( RcdFound4 == 1 )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "PRODUCTOID");
               AnyError = 1;
               GX_FocusControl = edtProductoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( A16ProductoId != Z16ProductoId )
            {
               A16ProductoId = Z16ProductoId;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
               GX_msglist.addItem(context.GetMessage( "GXM_getbeforeupd", ""), "CandidateKeyNotFound", 1, "PRODUCTOID");
               AnyError = 1;
               GX_FocusControl = edtProductoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               A22ProductoPrecio = O22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               delete( ) ;
               AfterTrn( ) ;
               GX_FocusControl = edtProductoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else
            {
               Gx_mode = "UPD";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Update record */
               A22ProductoPrecio = O22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               Update034( ) ;
               GX_FocusControl = edtProductoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
         }
         else
         {
            if ( A16ProductoId != Z16ProductoId )
            {
               Gx_mode = "INS";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Insert record */
               A22ProductoPrecio = O22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               GX_FocusControl = edtProductoId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               Insert034( ) ;
               if ( AnyError == 1 )
               {
                  GX_FocusControl = "";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
            }
            else
            {
               if ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PRODUCTOID");
                  AnyError = 1;
                  GX_FocusControl = edtProductoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  /* Insert record */
                  A22ProductoPrecio = O22ProductoPrecio;
                  n22ProductoPrecio = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                  GX_FocusControl = edtProductoId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  Insert034( ) ;
                  if ( AnyError == 1 )
                  {
                     GX_FocusControl = "";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
            }
         }
         AfterTrn( ) ;
      }

      protected void btn_delete( )
      {
         if ( A16ProductoId != Z16ProductoId )
         {
            A16ProductoId = Z16ProductoId;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
            GX_msglist.addItem(context.GetMessage( "GXM_getbeforedlt", ""), 1, "PRODUCTOID");
            AnyError = 1;
            GX_FocusControl = edtProductoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         else
         {
            A22ProductoPrecio = O22ProductoPrecio;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            delete( ) ;
            AfterTrn( ) ;
            GX_FocusControl = edtProductoId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError != 0 )
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            getByPrimaryKey( ) ;
         }
         CloseOpenCursors();
      }

      protected void btn_get( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         if ( RcdFound4 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_keynfound", ""), "PrimaryKeyNotFound", 1, "PRODUCTOID");
            AnyError = 1;
         }
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_first( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart034( ) ;
         if ( RcdFound4 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd034( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_previous( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_previous( ) ;
         if ( RcdFound4 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_next( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_next( ) ;
         if ( RcdFound4 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_last( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart034( ) ;
         if ( RcdFound4 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            while ( RcdFound4 != 0 )
            {
               ScanNext034( ) ;
            }
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd034( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_select( )
      {
         getEqualNoModal( ) ;
      }

      protected void CheckOptimisticConcurrency034( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T000316 */
            pr_default.execute(11, new Object[] {A16ProductoId});
            if ( (pr_default.getStatus(11) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Producto"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            if ( (pr_default.getStatus(11) == 101) || ( StringUtil.StrCmp(Z20ProductoDescripcion, T000316_A20ProductoDescripcion[0]) != 0 ) || ( StringUtil.StrCmp(Z21ProductoEstado, T000316_A21ProductoEstado[0]) != 0 ) || ( StringUtil.StrCmp(Z23ProductoTipo, T000316_A23ProductoTipo[0]) != 0 ) || ( StringUtil.StrCmp(Z51ProductoReceta, T000316_A51ProductoReceta[0]) != 0 ) || ( Z52ProductoTiempoPreparacion != T000316_A52ProductoTiempoPreparacion[0] ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"Producto"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert034( )
      {
         BeforeValidate034( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable034( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM034( 0) ;
            CheckOptimisticConcurrency034( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm034( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert034( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000317 */
                     pr_default.execute(12, new Object[] {A16ProductoId, A20ProductoDescripcion, A21ProductoEstado, A23ProductoTipo, A51ProductoReceta, A52ProductoTiempoPreparacion});
                     pr_default.close(12);
                     dsDefault.SmartCacheProvider.SetUpdated("Producto") ;
                     if ( (pr_default.getStatus(12) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel034( ) ;
                           if ( AnyError == 0 )
                           {
                              /* Save values for previous() function. */
                              GX_msglist.addItem(context.GetMessage( "GXM_sucadded", ""), 0, "");
                              ResetCaption030( ) ;
                           }
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load034( ) ;
            }
            EndLevel034( ) ;
         }
         CloseExtendedTableCursors034( ) ;
      }

      protected void Update034( )
      {
         BeforeValidate034( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable034( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency034( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm034( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate034( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000318 */
                     pr_default.execute(13, new Object[] {A20ProductoDescripcion, A21ProductoEstado, A23ProductoTipo, A51ProductoReceta, A52ProductoTiempoPreparacion, A16ProductoId});
                     pr_default.close(13);
                     dsDefault.SmartCacheProvider.SetUpdated("Producto") ;
                     if ( (pr_default.getStatus(13) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Producto"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate034( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel034( ) ;
                           if ( AnyError == 0 )
                           {
                              getByPrimaryKey( ) ;
                              GX_msglist.addItem(context.GetMessage( "GXM_sucupdated", ""), 0, "");
                              ResetCaption030( ) ;
                           }
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel034( ) ;
         }
         CloseExtendedTableCursors034( ) ;
      }

      protected void DeferredUpdate034( )
      {
      }

      protected void delete( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate034( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency034( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls034( ) ;
            AfterConfirm034( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete034( ) ;
               if ( AnyError == 0 )
               {
                  A22ProductoPrecio = O22ProductoPrecio;
                  n22ProductoPrecio = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                  ScanStart037( ) ;
                  while ( RcdFound7 != 0 )
                  {
                     getByPrimaryKey037( ) ;
                     Delete037( ) ;
                     ScanNext037( ) ;
                     O22ProductoPrecio = A22ProductoPrecio;
                     n22ProductoPrecio = false;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                  }
                  ScanEnd037( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000319 */
                     pr_default.execute(14, new Object[] {A16ProductoId});
                     pr_default.close(14);
                     dsDefault.SmartCacheProvider.SetUpdated("Producto") ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( delete) rules */
                        /* End of After( delete) rules */
                        if ( AnyError == 0 )
                        {
                           move_next( ) ;
                           if ( RcdFound4 == 0 )
                           {
                              InitAll034( ) ;
                              Gx_mode = "INS";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           else
                           {
                              getByPrimaryKey( ) ;
                              Gx_mode = "UPD";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           GX_msglist.addItem(context.GetMessage( "GXM_sucdeleted", ""), 0, "");
                           ResetCaption030( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
         }
         sMode4 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel034( ) ;
         Gx_mode = sMode4;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls034( )
      {
         standaloneModal( ) ;
         if ( AnyError == 0 )
         {
            /* Delete mode formulas */
            /* Using cursor T000321 */
            pr_default.execute(15, new Object[] {A16ProductoId});
            if ( (pr_default.getStatus(15) != 101) )
            {
               A22ProductoPrecio = T000321_A22ProductoPrecio[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               n22ProductoPrecio = T000321_n22ProductoPrecio[0];
            }
            else
            {
               A22ProductoPrecio = 0;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            pr_default.close(15);
         }
         if ( AnyError == 0 )
         {
            /* Using cursor T000322 */
            pr_default.execute(16, new Object[] {A16ProductoId});
            if ( (pr_default.getStatus(16) != 101) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_del", new   object[]  {"Linea"}), "CannotDeleteReferencedRecord", 1, "");
               AnyError = 1;
            }
            pr_default.close(16);
         }
      }

      protected void ProcessNestedLevel037( )
      {
         s22ProductoPrecio = O22ProductoPrecio;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         nGXsfl_71_idx = 0;
         while ( nGXsfl_71_idx < nRC_Gridproducto_ingrediente )
         {
            ReadRow037( ) ;
            if ( ( nRcdExists_7 != 0 ) || ( nIsMod_7 != 0 ) )
            {
               standaloneNotModal037( ) ;
               GetKey037( ) ;
               if ( ( nRcdExists_7 == 0 ) && ( nRcdDeleted_7 == 0 ) )
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  Insert037( ) ;
               }
               else
               {
                  if ( RcdFound7 != 0 )
                  {
                     if ( ( nRcdDeleted_7 != 0 ) && ( nRcdExists_7 != 0 ) )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        Delete037( ) ;
                     }
                     else
                     {
                        if ( ( nIsMod_7 != 0 ) && ( nRcdExists_7 != 0 ) )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           Update037( ) ;
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_7 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "INGREDIENTEID");
                        AnyError = 1;
                        GX_FocusControl = edtIngredienteId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
               O22ProductoPrecio = A22ProductoPrecio;
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            ChangePostValue( edtIngredienteId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A24IngredienteId), 10, 0, ",", ""))) ;
            ChangePostValue( edtProductoIngredienteCantidad_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A25ProductoIngredienteCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( edtIngredienteCosto_Internalname, StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( edtProductoIngredienteCosto_Internalname, StringUtil.LTrim( StringUtil.NToC( A44ProductoIngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z24IngredienteId_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z24IngredienteId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z25ProductoIngredienteCantidad_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z25ProductoIngredienteCantidad), 3, 0, ",", ""))) ;
            ChangePostValue( "T44ProductoIngredienteCosto_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( O44ProductoIngredienteCosto, 5, 2, ",", ""))) ;
            ChangePostValue( "nRcdDeleted_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_7), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_7), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_7_"+sGXsfl_71_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_7), 4, 0, ",", ""))) ;
            if ( nIsMod_7 != 0 )
            {
               ChangePostValue( "INGREDIENTEID_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCantidad_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteCosto_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCosto_Enabled), 5, 0, ".", ""))) ;
            }
         }
         /* Start of After( level) rules */
         /* End of After( level) rules */
         InitAll037( ) ;
         if ( AnyError != 0 )
         {
            O22ProductoPrecio = s22ProductoPrecio;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         nRcdExists_7 = 0;
         nIsMod_7 = 0;
         nRcdDeleted_7 = 0;
      }

      protected void ProcessLevel034( )
      {
         /* Save parent mode. */
         sMode4 = Gx_mode;
         ProcessNestedLevel037( ) ;
         if ( AnyError != 0 )
         {
            O22ProductoPrecio = s22ProductoPrecio;
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         /* Restore parent mode. */
         Gx_mode = sMode4;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         /* ' Update level parameters */
      }

      protected void EndLevel034( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(11);
         }
         if ( AnyError == 0 )
         {
            BeforeComplete034( ) ;
         }
         if ( AnyError == 0 )
         {
            pr_default.close(10);
            pr_default.close(9);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(15);
            pr_default.close(2);
            context.CommitDataStores("Producto");
            if ( AnyError == 0 )
            {
               ConfirmValues030( ) ;
            }
            /* After transaction rules */
            /* Execute 'After Trn' event if defined. */
            trnEnded = 1;
         }
         else
         {
            pr_default.close(10);
            pr_default.close(9);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(15);
            pr_default.close(2);
            context.RollbackDataStores("Producto");
         }
         IsModified = 0;
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart034( )
      {
         /* Using cursor T000323 */
         pr_default.execute(17);
         RcdFound4 = 0;
         if ( (pr_default.getStatus(17) != 101) )
         {
            RcdFound4 = 1;
            A16ProductoId = T000323_A16ProductoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext034( )
      {
         /* Scan next routine */
         pr_default.readNext(17);
         RcdFound4 = 0;
         if ( (pr_default.getStatus(17) != 101) )
         {
            RcdFound4 = 1;
            A16ProductoId = T000323_A16ProductoId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
         }
      }

      protected void ScanEnd034( )
      {
      }

      protected void AfterConfirm034( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert034( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate034( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete034( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete034( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate034( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes034( )
      {
         edtProductoId_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoId_Enabled), 5, 0)));
         edtProductoDescripcion_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoDescripcion_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoDescripcion_Enabled), 5, 0)));
         edtProductoEstado_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoEstado_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoEstado_Enabled), 5, 0)));
         edtProductoTipo_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoTipo_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoTipo_Enabled), 5, 0)));
         edtProductoReceta_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoReceta_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoReceta_Enabled), 5, 0)));
         edtProductoTiempoPreparacion_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoTiempoPreparacion_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoTiempoPreparacion_Enabled), 5, 0)));
         edtProductoPrecio_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtProductoPrecio_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtProductoPrecio_Enabled), 5, 0)));
      }

      protected void ZM037( short GX_JID )
      {
         if ( ( GX_JID == 5 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z25ProductoIngredienteCantidad = T00033_A25ProductoIngredienteCantidad[0];
            }
            else
            {
               Z25ProductoIngredienteCantidad = A25ProductoIngredienteCantidad;
            }
         }
         if ( GX_JID == -5 )
         {
            Z16ProductoId = A16ProductoId;
            Z25ProductoIngredienteCantidad = A25ProductoIngredienteCantidad;
            Z24IngredienteId = A24IngredienteId;
            Z26IngredienteCosto = A26IngredienteCosto;
         }
      }

      protected void standaloneNotModal037( )
      {
      }

      protected void standaloneModal037( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            edtIngredienteId_Enabled = 0;
         }
         else
         {
            edtIngredienteId_Enabled = 1;
         }
      }

      protected void Load037( )
      {
         /* Using cursor T000324 */
         pr_default.execute(18, new Object[] {A16ProductoId, A24IngredienteId});
         if ( (pr_default.getStatus(18) != 101) )
         {
            RcdFound7 = 1;
            A25ProductoIngredienteCantidad = T000324_A25ProductoIngredienteCantidad[0];
            A26IngredienteCosto = T000324_A26IngredienteCosto[0];
            ZM037( -5) ;
         }
         pr_default.close(18);
         OnLoadActions037( ) ;
      }

      protected void OnLoadActions037( )
      {
         A44ProductoIngredienteCosto = (decimal)(A25ProductoIngredienteCantidad*A26IngredienteCosto);
         O44ProductoIngredienteCosto = A44ProductoIngredienteCosto;
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
         {
            A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto);
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         else
         {
            if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
            {
               A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto-O44ProductoIngredienteCosto);
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
               {
                  A22ProductoPrecio = (decimal)(O22ProductoPrecio-O44ProductoIngredienteCosto);
                  n22ProductoPrecio = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               }
            }
         }
      }

      protected void CheckExtendedTable037( )
      {
         Gx_BScreen = 1;
         standaloneModal037( ) ;
         /* Using cursor T00034 */
         pr_default.execute(2, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(2) == 101) )
         {
            GX_msglist.addItem("No existe 'Ingrediente'.", "ForeignKeyNotFound", 1, "INGREDIENTEID");
            AnyError = 1;
            GX_FocusControl = edtIngredienteId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         A26IngredienteCosto = T00034_A26IngredienteCosto[0];
         pr_default.close(2);
         A44ProductoIngredienteCosto = (decimal)(A25ProductoIngredienteCantidad*A26IngredienteCosto);
         if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
         {
            A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto);
            n22ProductoPrecio = false;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         }
         else
         {
            if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
            {
               A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto-O44ProductoIngredienteCosto);
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
               {
                  A22ProductoPrecio = (decimal)(O22ProductoPrecio-O44ProductoIngredienteCosto);
                  n22ProductoPrecio = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               }
            }
         }
      }

      protected void CloseExtendedTableCursors037( )
      {
         pr_default.close(2);
      }

      protected void enableDisable037( )
      {
      }

      protected void gxLoad_6( long A24IngredienteId )
      {
         /* Using cursor T000325 */
         pr_default.execute(19, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(19) == 101) )
         {
            GX_msglist.addItem("No existe 'Ingrediente'.", "ForeignKeyNotFound", 1, "INGREDIENTEID");
            AnyError = 1;
            GX_FocusControl = edtIngredienteId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         A26IngredienteCosto = T000325_A26IngredienteCosto[0];
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("\""+GXUtil.EncodeJSConstant( StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ".", "")))+"\"");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(19) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(19);
      }

      protected void GetKey037( )
      {
         /* Using cursor T000326 */
         pr_default.execute(20, new Object[] {A16ProductoId, A24IngredienteId});
         if ( (pr_default.getStatus(20) != 101) )
         {
            RcdFound7 = 1;
         }
         else
         {
            RcdFound7 = 0;
         }
         pr_default.close(20);
      }

      protected void getByPrimaryKey037( )
      {
         /* Using cursor T00033 */
         pr_default.execute(1, new Object[] {A16ProductoId, A24IngredienteId});
         if ( (pr_default.getStatus(1) != 101) )
         {
            ZM037( 5) ;
            RcdFound7 = 1;
            InitializeNonKey037( ) ;
            A25ProductoIngredienteCantidad = T00033_A25ProductoIngredienteCantidad[0];
            A24IngredienteId = T00033_A24IngredienteId[0];
            Z16ProductoId = A16ProductoId;
            Z24IngredienteId = A24IngredienteId;
            sMode7 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal037( ) ;
            Load037( ) ;
            Gx_mode = sMode7;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound7 = 0;
            InitializeNonKey037( ) ;
            sMode7 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal037( ) ;
            Gx_mode = sMode7;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         if ( ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
         {
            DisableAttributes037( ) ;
         }
         pr_default.close(1);
      }

      protected void CheckOptimisticConcurrency037( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T00032 */
            pr_default.execute(0, new Object[] {A16ProductoId, A24IngredienteId});
            if ( (pr_default.getStatus(0) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"ProductoIngrediente"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            if ( (pr_default.getStatus(0) == 101) || ( Z25ProductoIngredienteCantidad != T00032_A25ProductoIngredienteCantidad[0] ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"ProductoIngrediente"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert037( )
      {
         BeforeValidate037( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable037( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM037( 0) ;
            CheckOptimisticConcurrency037( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm037( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert037( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000327 */
                     pr_default.execute(21, new Object[] {A16ProductoId, A25ProductoIngredienteCantidad, A24IngredienteId});
                     pr_default.close(21);
                     dsDefault.SmartCacheProvider.SetUpdated("ProductoIngrediente") ;
                     if ( (pr_default.getStatus(21) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           /* Save values for previous() function. */
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load037( ) ;
            }
            EndLevel037( ) ;
         }
         CloseExtendedTableCursors037( ) ;
      }

      protected void Update037( )
      {
         BeforeValidate037( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable037( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency037( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm037( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate037( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000328 */
                     pr_default.execute(22, new Object[] {A25ProductoIngredienteCantidad, A16ProductoId, A24IngredienteId});
                     pr_default.close(22);
                     dsDefault.SmartCacheProvider.SetUpdated("ProductoIngrediente") ;
                     if ( (pr_default.getStatus(22) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"ProductoIngrediente"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate037( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           getByPrimaryKey037( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel037( ) ;
         }
         CloseExtendedTableCursors037( ) ;
      }

      protected void DeferredUpdate037( )
      {
      }

      protected void Delete037( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate037( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency037( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls037( ) ;
            AfterConfirm037( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete037( ) ;
               if ( AnyError == 0 )
               {
                  /* No cascading delete specified. */
                  /* Using cursor T000329 */
                  pr_default.execute(23, new Object[] {A16ProductoId, A24IngredienteId});
                  pr_default.close(23);
                  dsDefault.SmartCacheProvider.SetUpdated("ProductoIngrediente") ;
                  if ( AnyError == 0 )
                  {
                     /* Start of After( delete) rules */
                     /* End of After( delete) rules */
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
         }
         sMode7 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel037( ) ;
         Gx_mode = sMode7;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls037( )
      {
         standaloneModal037( ) ;
         if ( AnyError == 0 )
         {
            /* Delete mode formulas */
            /* Using cursor T000330 */
            pr_default.execute(24, new Object[] {A24IngredienteId});
            A26IngredienteCosto = T000330_A26IngredienteCosto[0];
            pr_default.close(24);
            A44ProductoIngredienteCosto = (decimal)(A25ProductoIngredienteCantidad*A26IngredienteCosto);
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto);
               n22ProductoPrecio = false;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
            }
            else
            {
               if ( ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )  )
               {
                  A22ProductoPrecio = (decimal)(O22ProductoPrecio+A44ProductoIngredienteCosto-O44ProductoIngredienteCosto);
                  n22ProductoPrecio = false;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
               }
               else
               {
                  if ( ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )  )
                  {
                     A22ProductoPrecio = (decimal)(O22ProductoPrecio-O44ProductoIngredienteCosto);
                     n22ProductoPrecio = false;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
                  }
               }
            }
         }
      }

      protected void EndLevel037( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(0);
         }
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart037( )
      {
         /* Scan By routine */
         /* Using cursor T000331 */
         pr_default.execute(25, new Object[] {A16ProductoId});
         RcdFound7 = 0;
         if ( (pr_default.getStatus(25) != 101) )
         {
            RcdFound7 = 1;
            A24IngredienteId = T000331_A24IngredienteId[0];
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext037( )
      {
         /* Scan next routine */
         pr_default.readNext(25);
         RcdFound7 = 0;
         if ( (pr_default.getStatus(25) != 101) )
         {
            RcdFound7 = 1;
            A24IngredienteId = T000331_A24IngredienteId[0];
         }
      }

      protected void ScanEnd037( )
      {
         pr_default.close(1);
      }

      protected void AfterConfirm037( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert037( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate037( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete037( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete037( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate037( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes037( )
      {
         edtIngredienteId_Enabled = 0;
         edtProductoIngredienteCantidad_Enabled = 0;
         edtIngredienteCosto_Enabled = 0;
         edtProductoIngredienteCosto_Enabled = 0;
      }

      protected void AddRow037( )
      {
         nGXsfl_71_idx = (short)(nGXsfl_71_idx+1);
         sGXsfl_71_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_71_idx), 4, 0)), 4, "0");
         edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
         imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
         edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
         edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
         edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
         SendRow037( ) ;
      }

      protected void SendRow037( )
      {
         Gridproducto_ingredienteRow = GXWebRow.GetNew(context);
         if ( subGridproducto_ingrediente_Backcolorstyle == 0 )
         {
            /* None style subfile background logic. */
            subGridproducto_ingrediente_Backstyle = 0;
            if ( StringUtil.StrCmp(subGridproducto_ingrediente_Class, "") != 0 )
            {
               subGridproducto_ingrediente_Linesclass = subGridproducto_ingrediente_Class+"Odd";
            }
         }
         else if ( subGridproducto_ingrediente_Backcolorstyle == 1 )
         {
            /* Uniform style subfile background logic. */
            subGridproducto_ingrediente_Backstyle = 0;
            subGridproducto_ingrediente_Backcolor = subGridproducto_ingrediente_Allbackcolor;
            if ( StringUtil.StrCmp(subGridproducto_ingrediente_Class, "") != 0 )
            {
               subGridproducto_ingrediente_Linesclass = subGridproducto_ingrediente_Class+"Uniform";
            }
         }
         else if ( subGridproducto_ingrediente_Backcolorstyle == 2 )
         {
            /* Header style subfile background logic. */
            subGridproducto_ingrediente_Backstyle = 1;
            if ( StringUtil.StrCmp(subGridproducto_ingrediente_Class, "") != 0 )
            {
               subGridproducto_ingrediente_Linesclass = subGridproducto_ingrediente_Class+"Odd";
            }
            subGridproducto_ingrediente_Backcolor = (int)(0xF0F0F0);
         }
         else if ( subGridproducto_ingrediente_Backcolorstyle == 3 )
         {
            /* Report style subfile background logic. */
            subGridproducto_ingrediente_Backstyle = 1;
            if ( (int)(nGXsfl_71_idx % (2)) == 0 )
            {
               subGridproducto_ingrediente_Backcolor = (int)(0x0);
               if ( StringUtil.StrCmp(subGridproducto_ingrediente_Class, "") != 0 )
               {
                  subGridproducto_ingrediente_Linesclass = subGridproducto_ingrediente_Class+"Even";
               }
            }
            else
            {
               subGridproducto_ingrediente_Backcolor = (int)(0xF0F0F0);
               if ( StringUtil.StrCmp(subGridproducto_ingrediente_Class, "") != 0 )
               {
                  subGridproducto_ingrediente_Linesclass = subGridproducto_ingrediente_Class+"Odd";
               }
            }
         }
         imgprompt_24_Link = ((StringUtil.StrCmp(Gx_mode, "DSP")==0)||(StringUtil.StrCmp(Gx_mode, "UPD")==0) ? "" : "javascript:"+"gx.popup.openPrompt('"+"gx0060.aspx"+"',["+"{Ctrl:gx.dom.el('"+"INGREDIENTEID_"+sGXsfl_71_idx+"'), id:'"+"INGREDIENTEID_"+sGXsfl_71_idx+"'"+",IOType:'out'}"+"],"+"gx.dom.form()."+"nIsMod_7_"+sGXsfl_71_idx+","+"'', false"+","+"false"+");");
         /* * Property Link not supported in */
         /* * Property Link not supported in */
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_7_" + sGXsfl_71_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 72,'',false,'" + sGXsfl_71_idx + "',71)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridproducto_ingredienteRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtIngredienteId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A24IngredienteId), 10, 0, ",", "")),StringUtil.LTrim( context.localUtil.Format( (decimal)(A24IngredienteId), "ZZZZZZZZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(72);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtIngredienteId_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtIngredienteId_Enabled,(short)1,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)10,(short)0,(short)0,(short)71,(short)1,(short)-1,(short)0,(bool)true,(String)"Id",(String)"right"});
         /* Subfile cell */
         /* Static images/pictures */
         ClassString = "Image";
         StyleString = "";
         Gridproducto_ingredienteRow.AddColumnProperties("bitmap", 1, isAjaxCallMode( ), new Object[] {(String)imgprompt_24_Internalname,context.GetImagePath( "f5b04895-0024-488b-8e3b-b687ca4598ee", "", context.GetTheme( )),(String)imgprompt_24_Link,(String)"",(String)"",context.GetTheme( ),(int)imgprompt_24_Visible,(short)1,(String)"",(String)"",(short)0,(short)0,(short)0,(String)"",(short)0,(String)"",(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)"",(String)"",(String)"",(String)"''",(String)"",(short)1,(bool)false,(bool)false});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_7_" + sGXsfl_71_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 73,'',false,'" + sGXsfl_71_idx + "',71)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridproducto_ingredienteRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtProductoIngredienteCantidad_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A25ProductoIngredienteCantidad), 3, 0, ",", "")),((edtProductoIngredienteCantidad_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A25ProductoIngredienteCantidad), "ZZ9")) : context.localUtil.Format( (decimal)(A25ProductoIngredienteCantidad), "ZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(73);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtProductoIngredienteCantidad_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtProductoIngredienteCantidad_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)3,(short)0,(short)0,(short)71,(short)1,(short)-1,(short)0,(bool)true,(String)"Cantidad",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridproducto_ingredienteRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtIngredienteCosto_Internalname,StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ",", "")),((edtIngredienteCosto_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A26IngredienteCosto, "Z9.99")) : context.localUtil.Format( A26IngredienteCosto, "Z9.99")),(String)"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtIngredienteCosto_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtIngredienteCosto_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)5,(short)0,(short)0,(short)71,(short)1,(short)-1,(short)0,(bool)true,(String)"Precio",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridproducto_ingredienteRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtProductoIngredienteCosto_Internalname,StringUtil.LTrim( StringUtil.NToC( A44ProductoIngredienteCosto, 5, 2, ",", "")),((edtProductoIngredienteCosto_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A44ProductoIngredienteCosto, "Z9.99")) : context.localUtil.Format( A44ProductoIngredienteCosto, "Z9.99")),(String)"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtProductoIngredienteCosto_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtProductoIngredienteCosto_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)5,(short)0,(short)0,(short)71,(short)1,(short)-1,(short)0,(bool)true,(String)"Precio",(String)"right"});
         context.httpAjaxContext.ajax_sending_grid_row(Gridproducto_ingredienteRow);
         GXCCtl = "Z24IngredienteId_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z24IngredienteId), 10, 0, ",", "")));
         GXCCtl = "Z25ProductoIngredienteCantidad_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z25ProductoIngredienteCantidad), 3, 0, ",", "")));
         GXCCtl = "O44ProductoIngredienteCosto_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( O44ProductoIngredienteCosto, 5, 2, ",", "")));
         GXCCtl = "nRcdDeleted_7_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_7), 4, 0, ",", "")));
         GXCCtl = "nRcdExists_7_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_7), 4, 0, ",", "")));
         GXCCtl = "nIsMod_7_" + sGXsfl_71_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_7), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "INGREDIENTEID_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteId_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCantidad_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "INGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredienteCosto_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProductoIngredienteCosto_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PROMPT_24_"+sGXsfl_71_idx+"Link", StringUtil.RTrim( imgprompt_24_Link));
         context.httpAjaxContext.ajax_sending_grid_row(null);
         Gridproducto_ingredienteContainer.AddRow(Gridproducto_ingredienteRow);
      }

      protected void ReadRow037( )
      {
         nGXsfl_71_idx = (short)(nGXsfl_71_idx+1);
         sGXsfl_71_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_71_idx), 4, 0)), 4, "0");
         edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
         imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
         edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
         edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
         edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
         edtIngredienteId_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEID_"+sGXsfl_71_idx+"Enabled"), ",", "."));
         edtProductoIngredienteCantidad_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx+"Enabled"), ",", "."));
         edtIngredienteCosto_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled"), ",", "."));
         edtProductoIngredienteCosto_Enabled = (int)(context.localUtil.CToN( cgiGet( "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx+"Enabled"), ",", "."));
         imgprompt_24_Link = cgiGet( "PROMPT_24_"+sGXsfl_71_idx+"Link");
         if ( ( ( context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "INGREDIENTEID");
            AnyError = 1;
            GX_FocusControl = edtIngredienteId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A24IngredienteId = 0;
         }
         else
         {
            A24IngredienteId = (long)(context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", "."));
         }
         if ( ( ( context.localUtil.CToN( cgiGet( edtProductoIngredienteCantidad_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtProductoIngredienteCantidad_Internalname), ",", ".") > Convert.ToDecimal( 999 )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PRODUCTOINGREDIENTECANTIDAD");
            AnyError = 1;
            GX_FocusControl = edtProductoIngredienteCantidad_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A25ProductoIngredienteCantidad = 0;
         }
         else
         {
            A25ProductoIngredienteCantidad = (short)(context.localUtil.CToN( cgiGet( edtProductoIngredienteCantidad_Internalname), ",", "."));
         }
         A26IngredienteCosto = context.localUtil.CToN( cgiGet( edtIngredienteCosto_Internalname), ",", ".");
         A44ProductoIngredienteCosto = context.localUtil.CToN( cgiGet( edtProductoIngredienteCosto_Internalname), ",", ".");
         GXCCtl = "Z24IngredienteId_" + sGXsfl_71_idx;
         Z24IngredienteId = (long)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "Z25ProductoIngredienteCantidad_" + sGXsfl_71_idx;
         Z25ProductoIngredienteCantidad = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "O44ProductoIngredienteCosto_" + sGXsfl_71_idx;
         O44ProductoIngredienteCosto = context.localUtil.CToN( cgiGet( GXCCtl), ",", ".");
         GXCCtl = "nRcdDeleted_7_" + sGXsfl_71_idx;
         nRcdDeleted_7 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nRcdExists_7_" + sGXsfl_71_idx;
         nRcdExists_7 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nIsMod_7_" + sGXsfl_71_idx;
         nIsMod_7 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
      }

      protected void assign_properties_default( )
      {
         defedtIngredienteId_Enabled = edtIngredienteId_Enabled;
      }

      protected void ConfirmValues030( )
      {
         nGXsfl_71_idx = 0;
         sGXsfl_71_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_71_idx), 4, 0)), 4, "0");
         edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
         imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
         edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
         edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
         edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
         while ( nGXsfl_71_idx < nRC_Gridproducto_ingrediente )
         {
            nGXsfl_71_idx = (short)(nGXsfl_71_idx+1);
            sGXsfl_71_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_71_idx), 4, 0)), 4, "0");
            edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
            imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
            edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
            edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
            edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
            ChangePostValue( "Z24IngredienteId_"+sGXsfl_71_idx, cgiGet( "ZT_"+"Z24IngredienteId_"+sGXsfl_71_idx)) ;
            DeletePostValue( "ZT_"+"Z24IngredienteId_"+sGXsfl_71_idx) ;
            ChangePostValue( "Z25ProductoIngredienteCantidad_"+sGXsfl_71_idx, cgiGet( "ZT_"+"Z25ProductoIngredienteCantidad_"+sGXsfl_71_idx)) ;
            DeletePostValue( "ZT_"+"Z25ProductoIngredienteCantidad_"+sGXsfl_71_idx) ;
         }
         ChangePostValue( "O44ProductoIngredienteCosto", cgiGet( "T44ProductoIngredienteCosto")) ;
         DeletePostValue( "T44ProductoIngredienteCosto") ;
      }

      public override void RenderHtmlHeaders( )
      {
         GxWebStd.gx_html_headers( context, 0, "", "", Form.Meta, Form.Metaequiv, "IE=EmulateIE7");
      }

      public override void RenderHtmlOpenForm( )
      {
         context.WriteHtmlText( "<title>") ;
         context.SendWebValue( Form.Caption) ;
         context.WriteHtmlTextNl( "</title>") ;
         if ( StringUtil.Len( sDynURL) > 0 )
         {
            context.WriteHtmlText( "<BASE href=\""+sDynURL+"\" />") ;
         }
         define_styles( ) ;
         MasterPageObj.master_styles();
         if ( ! context.isSmartDevice( ) )
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgral.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         else
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxapiSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfxSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxhtmlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxtypesSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxpopupSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfrmutlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgridSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("JavaScripTableSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("rijndaelSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgralSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         context.WriteHtmlText( Form.Headerrawhtml) ;
         context.CloseHtmlHeader();
         FormProcess = " onkeyup=\"gx.evt.onkeyup(event)\" onkeypress=\"gx.evt.onkeypress(event,true,false)\" onkeydown=\"gx.evt.onkeypress(null,true,false)\"";
         context.WriteHtmlText( "<body") ;
         context.WriteHtmlText( " "+"class=\"Form\""+" "+" style=\"-moz-opacity:0;opacity:0;"+"background-color:"+context.BuildHTMLColor( Form.Backcolor)+";") ;
         if ( ! ( String.IsNullOrEmpty(StringUtil.RTrim( Form.Background)) ) )
         {
            context.WriteHtmlText( " background-image:url("+context.convertURL( Form.Background)+")") ;
         }
         context.WriteHtmlText( "\""+FormProcess+">") ;
         context.skipLines(1);
         context.WriteHtmlTextNl( "<form id=\"MAINFORM\" onsubmit=\"try{return gx.csv.validForm()}catch(e){return true;}\" name=\"MAINFORM\" method=\"post\" class=\"Form\" novalidate action=\""+formatLink("producto.aspx") +"\">") ;
         GxWebStd.gx_hidden_field( context, "_EventName", "");
         GxWebStd.gx_hidden_field( context, "_EventGridId", "");
         GxWebStd.gx_hidden_field( context, "_EventRowId", "");
      }

      public override void RenderHtmlCloseForm( )
      {
         /* Send hidden variables. */
         /* Send saved values. */
         GxWebStd.gx_hidden_field( context, "Z16ProductoId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z16ProductoId), 10, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z20ProductoDescripcion", StringUtil.RTrim( Z20ProductoDescripcion));
         GxWebStd.gx_hidden_field( context, "Z21ProductoEstado", StringUtil.RTrim( Z21ProductoEstado));
         GxWebStd.gx_hidden_field( context, "Z23ProductoTipo", StringUtil.RTrim( Z23ProductoTipo));
         GxWebStd.gx_hidden_field( context, "Z51ProductoReceta", StringUtil.RTrim( Z51ProductoReceta));
         GxWebStd.gx_hidden_field( context, "Z52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.NToC( Z52ProductoTiempoPreparacion, 4, 2, ",", "")));
         GxWebStd.gx_hidden_field( context, "O22ProductoPrecio", StringUtil.LTrim( StringUtil.NToC( O22ProductoPrecio, 5, 2, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsConfirmed", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsConfirmed), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsModified", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsModified), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Mode", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "nRC_Gridproducto_ingrediente", StringUtil.LTrim( StringUtil.NToC( (decimal)(nGXsfl_71_idx), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vMODE", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "GX_FocusControl", GX_FocusControl);
         SendAjaxEncryptionKey();
         SendComponentObjects();
         SendServerCommands();
         SendState();
         context.WriteHtmlTextNl( "</form>") ;
         include_jscripts( ) ;
      }

      public override short ExecuteStartEvent( )
      {
         standaloneStartup( ) ;
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0));
         return gxajaxcallmode ;
      }

      public override void RenderHtmlContent( )
      {
         Draw( ) ;
      }

      public override void DispatchEvents( )
      {
         Process( ) ;
      }

      public override bool HasEnterEvent( )
      {
         return true ;
      }

      public override String GetPgmname( )
      {
         return "Producto" ;
      }

      public override String GetPgmdesc( )
      {
         return "Producto" ;
      }

      public override GXWebForm GetForm( )
      {
         return Form ;
      }

      public override String GetSelfLink( )
      {
         return formatLink("producto.aspx")  ;
      }

      protected void InitializeNonKey034( )
      {
         A20ProductoDescripcion = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A20ProductoDescripcion", A20ProductoDescripcion);
         A21ProductoEstado = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A21ProductoEstado", A21ProductoEstado);
         A23ProductoTipo = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A23ProductoTipo", A23ProductoTipo);
         A51ProductoReceta = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A51ProductoReceta", A51ProductoReceta);
         A52ProductoTiempoPreparacion = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A52ProductoTiempoPreparacion", StringUtil.LTrim( StringUtil.Str( A52ProductoTiempoPreparacion, 4, 2)));
         A22ProductoPrecio = 0;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
         O22ProductoPrecio = A22ProductoPrecio;
         n22ProductoPrecio = false;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A22ProductoPrecio", StringUtil.LTrim( StringUtil.Str( A22ProductoPrecio, 5, 2)));
      }

      protected void InitAll034( )
      {
         A16ProductoId = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A16ProductoId", StringUtil.LTrim( StringUtil.Str( (decimal)(A16ProductoId), 10, 0)));
         InitializeNonKey034( ) ;
      }

      protected void StandaloneModalInsert( )
      {
      }

      protected void InitializeNonKey037( )
      {
         A44ProductoIngredienteCosto = 0;
         A25ProductoIngredienteCantidad = 0;
         A26IngredienteCosto = 0;
         O44ProductoIngredienteCosto = A44ProductoIngredienteCosto;
      }

      protected void InitAll037( )
      {
         A24IngredienteId = 0;
         InitializeNonKey037( ) ;
      }

      protected void StandaloneModalInsert037( )
      {
      }

      protected void define_styles( )
      {
         AddThemeStyleSheetFile("", context.GetTheme( )+".css", "?22151370");
         idxLst = 1;
         while ( idxLst <= Form.Jscriptsrc.Count )
         {
            context.AddJavascriptSource(StringUtil.RTrim( Form.Jscriptsrc.Item(idxLst)), "?201471722152324");
            idxLst = (int)(idxLst+1);
         }
         /* End function define_styles */
      }

      protected void include_jscripts( )
      {
         context.AddJavascriptSource("messages.spa.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("producto.js", "?201471722152324");
         /* End function include_jscripts */
      }

      protected void init_level_properties7( )
      {
         edtIngredienteId_Enabled = defedtIngredienteId_Enabled;
      }

      protected void init_default_properties( )
      {
         imgBtn_first_Internalname = "BTN_FIRST";
         imgBtn_first_separator_Internalname = "BTN_FIRST_SEPARATOR";
         imgBtn_previous_Internalname = "BTN_PREVIOUS";
         imgBtn_previous_separator_Internalname = "BTN_PREVIOUS_SEPARATOR";
         imgBtn_next_Internalname = "BTN_NEXT";
         imgBtn_next_separator_Internalname = "BTN_NEXT_SEPARATOR";
         imgBtn_last_Internalname = "BTN_LAST";
         imgBtn_last_separator_Internalname = "BTN_LAST_SEPARATOR";
         imgBtn_select_Internalname = "BTN_SELECT";
         imgBtn_select_separator_Internalname = "BTN_SELECT_SEPARATOR";
         imgBtn_enter2_Internalname = "BTN_ENTER2";
         imgBtn_enter2_separator_Internalname = "BTN_ENTER2_SEPARATOR";
         imgBtn_cancel2_Internalname = "BTN_CANCEL2";
         imgBtn_cancel2_separator_Internalname = "BTN_CANCEL2_SEPARATOR";
         imgBtn_delete2_Internalname = "BTN_DELETE2";
         imgBtn_delete2_separator_Internalname = "BTN_DELETE2_SEPARATOR";
         divSectiontoolbar_Internalname = "SECTIONTOOLBAR";
         tblTabletoolbar_Internalname = "TABLETOOLBAR";
         lblTextblockproductoid_Internalname = "TEXTBLOCKPRODUCTOID";
         edtProductoId_Internalname = "PRODUCTOID";
         lblTextblockproductodescripcion_Internalname = "TEXTBLOCKPRODUCTODESCRIPCION";
         edtProductoDescripcion_Internalname = "PRODUCTODESCRIPCION";
         lblTextblockproductoestado_Internalname = "TEXTBLOCKPRODUCTOESTADO";
         edtProductoEstado_Internalname = "PRODUCTOESTADO";
         lblTextblockproductotipo_Internalname = "TEXTBLOCKPRODUCTOTIPO";
         edtProductoTipo_Internalname = "PRODUCTOTIPO";
         lblTextblockproductoreceta_Internalname = "TEXTBLOCKPRODUCTORECETA";
         edtProductoReceta_Internalname = "PRODUCTORECETA";
         lblTextblockproductotiempopreparacion_Internalname = "TEXTBLOCKPRODUCTOTIEMPOPREPARACION";
         edtProductoTiempoPreparacion_Internalname = "PRODUCTOTIEMPOPREPARACION";
         lblTitleingrediente_Internalname = "TITLEINGREDIENTE";
         tblTable3_Internalname = "TABLE3";
         lblTextblockproductoprecio_Internalname = "TEXTBLOCKPRODUCTOPRECIO";
         edtProductoPrecio_Internalname = "PRODUCTOPRECIO";
         tblTable2_Internalname = "TABLE2";
         bttBtn_enter_Internalname = "BTN_ENTER";
         bttBtn_cancel_Internalname = "BTN_CANCEL";
         bttBtn_delete_Internalname = "BTN_DELETE";
         tblTable1_Internalname = "TABLE1";
         grpGroupdata_Internalname = "GROUPDATA";
         tblTablemain_Internalname = "TABLEMAIN";
         Form.Internalname = "FORM";
         subGridproducto_ingrediente_Internalname = "GRIDPRODUCTO_INGREDIENTE";
      }

      public override void initialize_properties( )
      {
         init_default_properties( ) ;
         Form.Headerrawhtml = "";
         Form.Background = "";
         Form.Backcolor = (int)(0xFFFFFF);
         Form.Caption = "Producto";
         edtProductoIngredienteCosto_Jsonclick = "";
         edtIngredienteCosto_Jsonclick = "";
         edtProductoIngredienteCantidad_Jsonclick = "";
         imgprompt_24_Visible = 1;
         imgprompt_24_Link = "";
         imgprompt_24_Visible = 1;
         edtIngredienteId_Jsonclick = "";
         subGridproducto_ingrediente_Class = "Grid";
         imgBtn_delete2_separator_Visible = 1;
         imgBtn_delete2_Enabled = 1;
         imgBtn_delete2_Visible = 1;
         imgBtn_cancel2_separator_Visible = 1;
         imgBtn_cancel2_Visible = 1;
         imgBtn_enter2_separator_Visible = 1;
         imgBtn_enter2_Enabled = 1;
         imgBtn_enter2_Visible = 1;
         imgBtn_select_separator_Visible = 1;
         imgBtn_select_Visible = 1;
         imgBtn_last_separator_Visible = 1;
         imgBtn_last_Visible = 1;
         imgBtn_next_separator_Visible = 1;
         imgBtn_next_Visible = 1;
         imgBtn_previous_separator_Visible = 1;
         imgBtn_previous_Visible = 1;
         imgBtn_first_separator_Visible = 1;
         imgBtn_first_Visible = 1;
         edtProductoPrecio_Jsonclick = "";
         edtProductoPrecio_Enabled = 0;
         subGridproducto_ingrediente_Allowcollapsing = 0;
         subGridproducto_ingrediente_Allowselection = 0;
         edtProductoIngredienteCosto_Enabled = 0;
         edtIngredienteCosto_Enabled = 0;
         edtProductoIngredienteCantidad_Enabled = 1;
         edtIngredienteId_Enabled = 1;
         subGridproducto_ingrediente_Backcolorstyle = 2;
         edtProductoTiempoPreparacion_Jsonclick = "";
         edtProductoTiempoPreparacion_Enabled = 1;
         edtProductoReceta_Enabled = 1;
         edtProductoTipo_Jsonclick = "";
         edtProductoTipo_Enabled = 1;
         edtProductoEstado_Jsonclick = "";
         edtProductoEstado_Enabled = 1;
         edtProductoDescripcion_Enabled = 1;
         edtProductoId_Jsonclick = "";
         edtProductoId_Enabled = 1;
         bttBtn_delete_Visible = 1;
         bttBtn_cancel_Visible = 1;
         bttBtn_enter_Visible = 1;
         context.GX_msglist.DisplayMode = 1;
      }

      protected void dynload_actions( )
      {
         /* End function dynload_actions */
      }

      protected void gxnrGridproducto_ingrediente_newrow( short nRC_Gridproducto_ingrediente ,
                                                          short nGXsfl_71_idx ,
                                                          String sGXsfl_71_idx )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         Gx_mode = "INS";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
         imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
         edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
         edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
         edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
         while ( nGXsfl_71_idx <= nRC_Gridproducto_ingrediente )
         {
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            standaloneNotModal037( ) ;
            standaloneModal037( ) ;
            dynload_actions( ) ;
            SendRow037( ) ;
            nGXsfl_71_idx = (short)(nGXsfl_71_idx+1);
            sGXsfl_71_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_71_idx), 4, 0)), 4, "0");
            edtIngredienteId_Internalname = "INGREDIENTEID_"+sGXsfl_71_idx;
            imgprompt_24_Internalname = "PROMPT_24_"+sGXsfl_71_idx;
            edtProductoIngredienteCantidad_Internalname = "PRODUCTOINGREDIENTECANTIDAD_"+sGXsfl_71_idx;
            edtIngredienteCosto_Internalname = "INGREDIENTECOSTO_"+sGXsfl_71_idx;
            edtProductoIngredienteCosto_Internalname = "PRODUCTOINGREDIENTECOSTO_"+sGXsfl_71_idx;
         }
         context.GX_webresponse.AddString(Gridproducto_ingredienteContainer.ToJavascriptSource());
         /* End function gxnrGridproducto_ingrediente_newrow */
      }

      protected void AfterKeyLoadScreen( )
      {
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         GX_FocusControl = edtProductoDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
         /* End function AfterKeyLoadScreen */
      }

      public void Valid_Productoid( long GX_Parm1 ,
                                    String GX_Parm2 ,
                                    String GX_Parm3 ,
                                    String GX_Parm4 ,
                                    String GX_Parm5 ,
                                    decimal GX_Parm6 ,
                                    decimal GX_Parm7 )
      {
         A16ProductoId = GX_Parm1;
         A20ProductoDescripcion = GX_Parm2;
         A21ProductoEstado = GX_Parm3;
         A23ProductoTipo = GX_Parm4;
         A51ProductoReceta = GX_Parm5;
         A52ProductoTiempoPreparacion = GX_Parm6;
         A22ProductoPrecio = GX_Parm7;
         n22ProductoPrecio = false;
         context.wbHandled = 1;
         AfterKeyLoadScreen( ) ;
         Draw( ) ;
         /* Using cursor T000321 */
         pr_default.execute(15, new Object[] {A16ProductoId});
         if ( (pr_default.getStatus(15) != 101) )
         {
            A22ProductoPrecio = T000321_A22ProductoPrecio[0];
            n22ProductoPrecio = T000321_n22ProductoPrecio[0];
         }
         else
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
         }
         pr_default.close(15);
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
            A22ProductoPrecio = 0;
            n22ProductoPrecio = false;
         }
         isValidOutput.Add((Object)(StringUtil.RTrim( A20ProductoDescripcion)));
         isValidOutput.Add((Object)(StringUtil.RTrim( A21ProductoEstado)));
         isValidOutput.Add((Object)(StringUtil.RTrim( A23ProductoTipo)));
         isValidOutput.Add((Object)(StringUtil.RTrim( A51ProductoReceta)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A52ProductoTiempoPreparacion, 4, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A22ProductoPrecio, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Gx_mode)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(Z16ProductoId), 10, 0, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z20ProductoDescripcion)));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z21ProductoEstado)));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z23ProductoTipo)));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z51ProductoReceta)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( Z52ProductoTiempoPreparacion, 4, 2, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( Z22ProductoPrecio, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( O22ProductoPrecio, 5, 2, ",", ""))));
         isValidOutput.Add((Object)(Gridproducto_ingredienteContainer));
         isValidOutput.Add((Object)(imgBtn_delete2_Enabled));
         isValidOutput.Add((Object)(imgBtn_enter2_Enabled));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void Valid_Ingredienteid( long GX_Parm1 ,
                                       decimal GX_Parm2 )
      {
         A24IngredienteId = GX_Parm1;
         A26IngredienteCosto = GX_Parm2;
         /* Using cursor T000330 */
         pr_default.execute(24, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(24) == 101) )
         {
            GX_msglist.addItem("No existe 'Ingrediente'.", "ForeignKeyNotFound", 1, "INGREDIENTEID");
            AnyError = 1;
            GX_FocusControl = edtIngredienteId_Internalname;
         }
         A26IngredienteCosto = T000330_A26IngredienteCosto[0];
         pr_default.close(24);
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
            A26IngredienteCosto = 0;
         }
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void cleanup( )
      {
         flushBuffer();
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
      }

      protected void CloseOpenCursors( )
      {
         pr_default.close(25);
         pr_default.close(24);
         pr_default.close(17);
         pr_default.close(10);
         pr_default.close(9);
         pr_default.close(15);
      }

      public override void initialize( )
      {
         sPrefix = "";
         scmdbuf = "";
         gxfirstwebparm = "";
         gxfirstwebparm_bkp = "";
         GXKey = "";
         PreviousTooltip = "";
         PreviousCaption = "";
         Form = new GXWebForm();
         GX_FocusControl = "";
         sStyleString = "";
         ClassString = "";
         StyleString = "";
         TempTags = "";
         bttBtn_enter_Jsonclick = "";
         bttBtn_cancel_Jsonclick = "";
         bttBtn_delete_Jsonclick = "";
         lblTextblockproductoid_Jsonclick = "";
         lblTextblockproductodescripcion_Jsonclick = "";
         A20ProductoDescripcion = "";
         lblTextblockproductoestado_Jsonclick = "";
         A21ProductoEstado = "";
         lblTextblockproductotipo_Jsonclick = "";
         A23ProductoTipo = "";
         lblTextblockproductoreceta_Jsonclick = "";
         A51ProductoReceta = "";
         lblTextblockproductotiempopreparacion_Jsonclick = "";
         Gridproducto_ingredienteContainer = new GXWebGrid( context);
         Gridproducto_ingredienteColumn = new GXWebColumn();
         Gx_mode = "";
         sMode7 = "";
         edtIngredienteId_Internalname = "";
         lblTextblockproductoprecio_Jsonclick = "";
         lblTitleingrediente_Jsonclick = "";
         imgBtn_first_Jsonclick = "";
         imgBtn_first_separator_Jsonclick = "";
         imgBtn_previous_Jsonclick = "";
         imgBtn_previous_separator_Jsonclick = "";
         imgBtn_next_Jsonclick = "";
         imgBtn_next_separator_Jsonclick = "";
         imgBtn_last_Jsonclick = "";
         imgBtn_last_separator_Jsonclick = "";
         imgBtn_select_Jsonclick = "";
         imgBtn_select_separator_Jsonclick = "";
         imgBtn_enter2_Jsonclick = "";
         imgBtn_enter2_separator_Jsonclick = "";
         imgBtn_cancel2_Jsonclick = "";
         imgBtn_cancel2_separator_Jsonclick = "";
         imgBtn_delete2_Jsonclick = "";
         imgBtn_delete2_separator_Jsonclick = "";
         Z20ProductoDescripcion = "";
         Z21ProductoEstado = "";
         Z23ProductoTipo = "";
         Z51ProductoReceta = "";
         sEvt = "";
         EvtGridId = "";
         EvtRowId = "";
         sEvtType = "";
         edtProductoIngredienteCantidad_Internalname = "";
         edtIngredienteCosto_Internalname = "";
         edtProductoIngredienteCosto_Internalname = "";
         T000310_A16ProductoId = new long[1] ;
         T000310_A20ProductoDescripcion = new String[] {""} ;
         T000310_A21ProductoEstado = new String[] {""} ;
         T000310_A23ProductoTipo = new String[] {""} ;
         T000310_A51ProductoReceta = new String[] {""} ;
         T000310_A52ProductoTiempoPreparacion = new decimal[1] ;
         T000310_A22ProductoPrecio = new decimal[1] ;
         T000310_n22ProductoPrecio = new bool[] {false} ;
         T00038_A22ProductoPrecio = new decimal[1] ;
         T00038_n22ProductoPrecio = new bool[] {false} ;
         T000312_A22ProductoPrecio = new decimal[1] ;
         T000312_n22ProductoPrecio = new bool[] {false} ;
         T000313_A16ProductoId = new long[1] ;
         T00036_A16ProductoId = new long[1] ;
         T00036_A20ProductoDescripcion = new String[] {""} ;
         T00036_A21ProductoEstado = new String[] {""} ;
         T00036_A23ProductoTipo = new String[] {""} ;
         T00036_A51ProductoReceta = new String[] {""} ;
         T00036_A52ProductoTiempoPreparacion = new decimal[1] ;
         sMode4 = "";
         T000314_A16ProductoId = new long[1] ;
         T000315_A16ProductoId = new long[1] ;
         T000316_A16ProductoId = new long[1] ;
         T000316_A20ProductoDescripcion = new String[] {""} ;
         T000316_A21ProductoEstado = new String[] {""} ;
         T000316_A23ProductoTipo = new String[] {""} ;
         T000316_A51ProductoReceta = new String[] {""} ;
         T000316_A52ProductoTiempoPreparacion = new decimal[1] ;
         T000321_A22ProductoPrecio = new decimal[1] ;
         T000321_n22ProductoPrecio = new bool[] {false} ;
         T000322_A1PedidoId = new long[1] ;
         T000322_A9PedidoLineaId = new long[1] ;
         T000323_A16ProductoId = new long[1] ;
         T000324_A16ProductoId = new long[1] ;
         T000324_A25ProductoIngredienteCantidad = new short[1] ;
         T000324_A26IngredienteCosto = new decimal[1] ;
         T000324_A24IngredienteId = new long[1] ;
         T00034_A26IngredienteCosto = new decimal[1] ;
         T000325_A26IngredienteCosto = new decimal[1] ;
         T000326_A16ProductoId = new long[1] ;
         T000326_A24IngredienteId = new long[1] ;
         T00033_A16ProductoId = new long[1] ;
         T00033_A25ProductoIngredienteCantidad = new short[1] ;
         T00033_A24IngredienteId = new long[1] ;
         T00032_A16ProductoId = new long[1] ;
         T00032_A25ProductoIngredienteCantidad = new short[1] ;
         T00032_A24IngredienteId = new long[1] ;
         T000330_A26IngredienteCosto = new decimal[1] ;
         T000331_A16ProductoId = new long[1] ;
         T000331_A24IngredienteId = new long[1] ;
         imgprompt_24_Internalname = "";
         Gridproducto_ingredienteRow = new GXWebRow();
         subGridproducto_ingrediente_Linesclass = "";
         ROClassString = "";
         GXCCtl = "";
         sDynURL = "";
         FormProcess = "";
         isValidOutput = new GxUnknownObjectCollection();
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.producto__default(),
            new Object[][] {
                new Object[] {
               T00032_A16ProductoId, T00032_A25ProductoIngredienteCantidad, T00032_A24IngredienteId
               }
               , new Object[] {
               T00033_A16ProductoId, T00033_A25ProductoIngredienteCantidad, T00033_A24IngredienteId
               }
               , new Object[] {
               T00034_A26IngredienteCosto
               }
               , new Object[] {
               T00035_A16ProductoId, T00035_A20ProductoDescripcion, T00035_A21ProductoEstado, T00035_A23ProductoTipo, T00035_A51ProductoReceta, T00035_A52ProductoTiempoPreparacion
               }
               , new Object[] {
               T00036_A16ProductoId, T00036_A20ProductoDescripcion, T00036_A21ProductoEstado, T00036_A23ProductoTipo, T00036_A51ProductoReceta, T00036_A52ProductoTiempoPreparacion
               }
               , new Object[] {
               T00038_A22ProductoPrecio, T00038_n22ProductoPrecio
               }
               , new Object[] {
               T000310_A16ProductoId, T000310_A20ProductoDescripcion, T000310_A21ProductoEstado, T000310_A23ProductoTipo, T000310_A51ProductoReceta, T000310_A52ProductoTiempoPreparacion, T000310_A22ProductoPrecio, T000310_n22ProductoPrecio
               }
               , new Object[] {
               T000312_A22ProductoPrecio, T000312_n22ProductoPrecio
               }
               , new Object[] {
               T000313_A16ProductoId
               }
               , new Object[] {
               T000314_A16ProductoId
               }
               , new Object[] {
               T000315_A16ProductoId
               }
               , new Object[] {
               T000316_A16ProductoId, T000316_A20ProductoDescripcion, T000316_A21ProductoEstado, T000316_A23ProductoTipo, T000316_A51ProductoReceta, T000316_A52ProductoTiempoPreparacion
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000321_A22ProductoPrecio, T000321_n22ProductoPrecio
               }
               , new Object[] {
               T000322_A1PedidoId, T000322_A9PedidoLineaId
               }
               , new Object[] {
               T000323_A16ProductoId
               }
               , new Object[] {
               T000324_A16ProductoId, T000324_A25ProductoIngredienteCantidad, T000324_A26IngredienteCosto, T000324_A24IngredienteId
               }
               , new Object[] {
               T000325_A26IngredienteCosto
               }
               , new Object[] {
               T000326_A16ProductoId, T000326_A24IngredienteId
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000330_A26IngredienteCosto
               }
               , new Object[] {
               T000331_A16ProductoId, T000331_A24IngredienteId
               }
            }
         );
      }

      private short nIsMod_7 ;
      private short GxWebError ;
      private short nRC_Gridproducto_ingrediente ;
      private short nGXsfl_71_idx=1 ;
      private short gxcookieaux ;
      private short IsConfirmed ;
      private short IsModified ;
      private short AnyError ;
      private short nKeyPressed ;
      private short initialized ;
      private short subGridproducto_ingrediente_Backcolorstyle ;
      private short A25ProductoIngredienteCantidad ;
      private short subGridproducto_ingrediente_Allowselection ;
      private short subGridproducto_ingrediente_Allowhovering ;
      private short subGridproducto_ingrediente_Allowcollapsing ;
      private short subGridproducto_ingrediente_Collapsed ;
      private short nBlankRcdCount7 ;
      private short nRcdExists_7 ;
      private short RcdFound7 ;
      private short nBlankRcdUsr7 ;
      private short nRcdDeleted_7 ;
      private short Z25ProductoIngredienteCantidad ;
      private short GX_JID ;
      private short RcdFound4 ;
      private short Gx_BScreen ;
      private short subGridproducto_ingrediente_Backstyle ;
      private short gxajaxcallmode ;
      private short wbTemp ;
      private int trnEnded ;
      private int bttBtn_enter_Visible ;
      private int bttBtn_cancel_Visible ;
      private int bttBtn_delete_Visible ;
      private int edtProductoId_Enabled ;
      private int edtProductoDescripcion_Enabled ;
      private int edtProductoEstado_Enabled ;
      private int edtProductoTipo_Enabled ;
      private int edtProductoReceta_Enabled ;
      private int edtProductoTiempoPreparacion_Enabled ;
      private int edtIngredienteId_Enabled ;
      private int edtProductoIngredienteCantidad_Enabled ;
      private int edtIngredienteCosto_Enabled ;
      private int edtProductoIngredienteCosto_Enabled ;
      private int subGridproducto_ingrediente_Selectioncolor ;
      private int subGridproducto_ingrediente_Hoveringcolor ;
      private int fRowAdded ;
      private int edtProductoPrecio_Enabled ;
      private int imgBtn_first_Visible ;
      private int imgBtn_first_separator_Visible ;
      private int imgBtn_previous_Visible ;
      private int imgBtn_previous_separator_Visible ;
      private int imgBtn_next_Visible ;
      private int imgBtn_next_separator_Visible ;
      private int imgBtn_last_Visible ;
      private int imgBtn_last_separator_Visible ;
      private int imgBtn_select_Visible ;
      private int imgBtn_select_separator_Visible ;
      private int imgBtn_enter2_Visible ;
      private int imgBtn_enter2_Enabled ;
      private int imgBtn_enter2_separator_Visible ;
      private int imgBtn_cancel2_Visible ;
      private int imgBtn_cancel2_separator_Visible ;
      private int imgBtn_delete2_Visible ;
      private int imgBtn_delete2_Enabled ;
      private int imgBtn_delete2_separator_Visible ;
      private int GRIDPRODUCTO_INGREDIENTE_nFirstRecordOnPage ;
      private int subGridproducto_ingrediente_Backcolor ;
      private int subGridproducto_ingrediente_Allbackcolor ;
      private int imgprompt_24_Visible ;
      private int defedtIngredienteId_Enabled ;
      private int idxLst ;
      private long A16ProductoId ;
      private long A24IngredienteId ;
      private long Z16ProductoId ;
      private long Z24IngredienteId ;
      private decimal A52ProductoTiempoPreparacion ;
      private decimal A26IngredienteCosto ;
      private decimal A44ProductoIngredienteCosto ;
      private decimal B22ProductoPrecio ;
      private decimal A22ProductoPrecio ;
      private decimal Z52ProductoTiempoPreparacion ;
      private decimal O22ProductoPrecio ;
      private decimal s22ProductoPrecio ;
      private decimal T44ProductoIngredienteCosto ;
      private decimal O44ProductoIngredienteCosto ;
      private decimal Z22ProductoPrecio ;
      private decimal Z26IngredienteCosto ;
      private String sPrefix ;
      private String sGXsfl_71_idx="0001" ;
      private String scmdbuf ;
      private String gxfirstwebparm ;
      private String gxfirstwebparm_bkp ;
      private String GXKey ;
      private String PreviousTooltip ;
      private String PreviousCaption ;
      private String GX_FocusControl ;
      private String edtProductoId_Internalname ;
      private String sStyleString ;
      private String tblTablemain_Internalname ;
      private String ClassString ;
      private String StyleString ;
      private String grpGroupdata_Internalname ;
      private String tblTable1_Internalname ;
      private String TempTags ;
      private String bttBtn_enter_Internalname ;
      private String bttBtn_enter_Jsonclick ;
      private String bttBtn_cancel_Internalname ;
      private String bttBtn_cancel_Jsonclick ;
      private String bttBtn_delete_Internalname ;
      private String bttBtn_delete_Jsonclick ;
      private String tblTable2_Internalname ;
      private String lblTextblockproductoid_Internalname ;
      private String lblTextblockproductoid_Jsonclick ;
      private String edtProductoId_Jsonclick ;
      private String lblTextblockproductodescripcion_Internalname ;
      private String lblTextblockproductodescripcion_Jsonclick ;
      private String edtProductoDescripcion_Internalname ;
      private String lblTextblockproductoestado_Internalname ;
      private String lblTextblockproductoestado_Jsonclick ;
      private String edtProductoEstado_Internalname ;
      private String A21ProductoEstado ;
      private String edtProductoEstado_Jsonclick ;
      private String lblTextblockproductotipo_Internalname ;
      private String lblTextblockproductotipo_Jsonclick ;
      private String edtProductoTipo_Internalname ;
      private String A23ProductoTipo ;
      private String edtProductoTipo_Jsonclick ;
      private String lblTextblockproductoreceta_Internalname ;
      private String lblTextblockproductoreceta_Jsonclick ;
      private String edtProductoReceta_Internalname ;
      private String lblTextblockproductotiempopreparacion_Internalname ;
      private String lblTextblockproductotiempopreparacion_Jsonclick ;
      private String edtProductoTiempoPreparacion_Internalname ;
      private String edtProductoTiempoPreparacion_Jsonclick ;
      private String Gx_mode ;
      private String sMode7 ;
      private String imgprompt_24_Link ;
      private String edtIngredienteId_Internalname ;
      private String lblTextblockproductoprecio_Internalname ;
      private String lblTextblockproductoprecio_Jsonclick ;
      private String edtProductoPrecio_Internalname ;
      private String edtProductoPrecio_Jsonclick ;
      private String tblTable3_Internalname ;
      private String lblTitleingrediente_Internalname ;
      private String lblTitleingrediente_Jsonclick ;
      private String tblTabletoolbar_Internalname ;
      private String divSectiontoolbar_Internalname ;
      private String imgBtn_first_Internalname ;
      private String imgBtn_first_Jsonclick ;
      private String imgBtn_first_separator_Internalname ;
      private String imgBtn_first_separator_Jsonclick ;
      private String imgBtn_previous_Internalname ;
      private String imgBtn_previous_Jsonclick ;
      private String imgBtn_previous_separator_Internalname ;
      private String imgBtn_previous_separator_Jsonclick ;
      private String imgBtn_next_Internalname ;
      private String imgBtn_next_Jsonclick ;
      private String imgBtn_next_separator_Internalname ;
      private String imgBtn_next_separator_Jsonclick ;
      private String imgBtn_last_Internalname ;
      private String imgBtn_last_Jsonclick ;
      private String imgBtn_last_separator_Internalname ;
      private String imgBtn_last_separator_Jsonclick ;
      private String imgBtn_select_Internalname ;
      private String imgBtn_select_Jsonclick ;
      private String imgBtn_select_separator_Internalname ;
      private String imgBtn_select_separator_Jsonclick ;
      private String imgBtn_enter2_Internalname ;
      private String imgBtn_enter2_Jsonclick ;
      private String imgBtn_enter2_separator_Internalname ;
      private String imgBtn_enter2_separator_Jsonclick ;
      private String imgBtn_cancel2_Internalname ;
      private String imgBtn_cancel2_Jsonclick ;
      private String imgBtn_cancel2_separator_Internalname ;
      private String imgBtn_cancel2_separator_Jsonclick ;
      private String imgBtn_delete2_Internalname ;
      private String imgBtn_delete2_Jsonclick ;
      private String imgBtn_delete2_separator_Internalname ;
      private String imgBtn_delete2_separator_Jsonclick ;
      private String Z21ProductoEstado ;
      private String Z23ProductoTipo ;
      private String sEvt ;
      private String EvtGridId ;
      private String EvtRowId ;
      private String sEvtType ;
      private String edtProductoIngredienteCantidad_Internalname ;
      private String edtIngredienteCosto_Internalname ;
      private String edtProductoIngredienteCosto_Internalname ;
      private String sMode4 ;
      private String imgprompt_24_Internalname ;
      private String subGridproducto_ingrediente_Class ;
      private String subGridproducto_ingrediente_Linesclass ;
      private String ROClassString ;
      private String edtIngredienteId_Jsonclick ;
      private String edtProductoIngredienteCantidad_Jsonclick ;
      private String edtIngredienteCosto_Jsonclick ;
      private String edtProductoIngredienteCosto_Jsonclick ;
      private String GXCCtl ;
      private String sDynURL ;
      private String FormProcess ;
      private String subGridproducto_ingrediente_Internalname ;
      private bool entryPointCalled ;
      private bool wbErr ;
      private bool n22ProductoPrecio ;
      private String A20ProductoDescripcion ;
      private String A51ProductoReceta ;
      private String Z20ProductoDescripcion ;
      private String Z51ProductoReceta ;
      private GxUnknownObjectCollection isValidOutput ;
      private GXMasterPage MasterPageObj ;
      private GXWebGrid Gridproducto_ingredienteContainer ;
      private GXWebRow Gridproducto_ingredienteRow ;
      private GXWebColumn Gridproducto_ingredienteColumn ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private long[] T000310_A16ProductoId ;
      private String[] T000310_A20ProductoDescripcion ;
      private String[] T000310_A21ProductoEstado ;
      private String[] T000310_A23ProductoTipo ;
      private String[] T000310_A51ProductoReceta ;
      private decimal[] T000310_A52ProductoTiempoPreparacion ;
      private decimal[] T000310_A22ProductoPrecio ;
      private bool[] T000310_n22ProductoPrecio ;
      private decimal[] T00038_A22ProductoPrecio ;
      private bool[] T00038_n22ProductoPrecio ;
      private decimal[] T000312_A22ProductoPrecio ;
      private bool[] T000312_n22ProductoPrecio ;
      private long[] T000313_A16ProductoId ;
      private long[] T00036_A16ProductoId ;
      private String[] T00036_A20ProductoDescripcion ;
      private String[] T00036_A21ProductoEstado ;
      private String[] T00036_A23ProductoTipo ;
      private String[] T00036_A51ProductoReceta ;
      private decimal[] T00036_A52ProductoTiempoPreparacion ;
      private long[] T000314_A16ProductoId ;
      private long[] T000315_A16ProductoId ;
      private long[] T000316_A16ProductoId ;
      private String[] T000316_A20ProductoDescripcion ;
      private String[] T000316_A21ProductoEstado ;
      private String[] T000316_A23ProductoTipo ;
      private String[] T000316_A51ProductoReceta ;
      private decimal[] T000316_A52ProductoTiempoPreparacion ;
      private decimal[] T000321_A22ProductoPrecio ;
      private bool[] T000321_n22ProductoPrecio ;
      private long[] T000322_A1PedidoId ;
      private long[] T000322_A9PedidoLineaId ;
      private long[] T000323_A16ProductoId ;
      private long[] T000324_A16ProductoId ;
      private short[] T000324_A25ProductoIngredienteCantidad ;
      private decimal[] T000324_A26IngredienteCosto ;
      private long[] T000324_A24IngredienteId ;
      private decimal[] T00034_A26IngredienteCosto ;
      private decimal[] T000325_A26IngredienteCosto ;
      private long[] T000326_A16ProductoId ;
      private long[] T000326_A24IngredienteId ;
      private long[] T00033_A16ProductoId ;
      private short[] T00033_A25ProductoIngredienteCantidad ;
      private long[] T00033_A24IngredienteId ;
      private long[] T00032_A16ProductoId ;
      private short[] T00032_A25ProductoIngredienteCantidad ;
      private long[] T00032_A24IngredienteId ;
      private decimal[] T000330_A26IngredienteCosto ;
      private long[] T000331_A16ProductoId ;
      private long[] T000331_A24IngredienteId ;
      private long[] T00035_A16ProductoId ;
      private String[] T00035_A20ProductoDescripcion ;
      private String[] T00035_A21ProductoEstado ;
      private String[] T00035_A23ProductoTipo ;
      private String[] T00035_A51ProductoReceta ;
      private decimal[] T00035_A52ProductoTiempoPreparacion ;
      private GXWebForm Form ;
   }

   public class producto__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
         ,new ForEachCursor(def[3])
         ,new ForEachCursor(def[4])
         ,new ForEachCursor(def[5])
         ,new ForEachCursor(def[6])
         ,new ForEachCursor(def[7])
         ,new ForEachCursor(def[8])
         ,new ForEachCursor(def[9])
         ,new ForEachCursor(def[10])
         ,new ForEachCursor(def[11])
         ,new UpdateCursor(def[12])
         ,new UpdateCursor(def[13])
         ,new UpdateCursor(def[14])
         ,new ForEachCursor(def[15])
         ,new ForEachCursor(def[16])
         ,new ForEachCursor(def[17])
         ,new ForEachCursor(def[18])
         ,new ForEachCursor(def[19])
         ,new ForEachCursor(def[20])
         ,new UpdateCursor(def[21])
         ,new UpdateCursor(def[22])
         ,new UpdateCursor(def[23])
         ,new ForEachCursor(def[24])
         ,new ForEachCursor(def[25])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmT00035 ;
          prmT00035 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000310 ;
          prmT000310 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00038 ;
          prmT00038 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000312 ;
          prmT000312 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000313 ;
          prmT000313 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00036 ;
          prmT00036 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000314 ;
          prmT000314 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000315 ;
          prmT000315 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000316 ;
          prmT000316 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000317 ;
          prmT000317 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProductoDescripcion",SqlDbType.VarChar,200,0} ,
          new Object[] {"@ProductoEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@ProductoTipo",SqlDbType.Char,1,0} ,
          new Object[] {"@ProductoReceta",SqlDbType.VarChar,255,0} ,
          new Object[] {"@ProductoTiempoPreparacion",SqlDbType.Decimal,4,2}
          } ;
          Object[] prmT000318 ;
          prmT000318 = new Object[] {
          new Object[] {"@ProductoDescripcion",SqlDbType.VarChar,200,0} ,
          new Object[] {"@ProductoEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@ProductoTipo",SqlDbType.Char,1,0} ,
          new Object[] {"@ProductoReceta",SqlDbType.VarChar,255,0} ,
          new Object[] {"@ProductoTiempoPreparacion",SqlDbType.Decimal,4,2} ,
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000319 ;
          prmT000319 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000322 ;
          prmT000322 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000323 ;
          prmT000323 = new Object[] {
          } ;
          Object[] prmT000324 ;
          prmT000324 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00034 ;
          prmT00034 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000325 ;
          prmT000325 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000326 ;
          prmT000326 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00033 ;
          prmT00033 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00032 ;
          prmT00032 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000327 ;
          prmT000327 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProductoIngredienteCantidad",SqlDbType.SmallInt,3,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000328 ;
          prmT000328 = new Object[] {
          new Object[] {"@ProductoIngredienteCantidad",SqlDbType.SmallInt,3,0} ,
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000329 ;
          prmT000329 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000331 ;
          prmT000331 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000321 ;
          prmT000321 = new Object[] {
          new Object[] {"@ProductoId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000330 ;
          prmT000330 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("T00032", "SELECT [ProductoId], [ProductoIngredienteCantidad], [IngredienteId] FROM [ProductoIngrediente] WITH (UPDLOCK) WHERE [ProductoId] = @ProductoId AND [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00032,1,0,true,false )
             ,new CursorDef("T00033", "SELECT [ProductoId], [ProductoIngredienteCantidad], [IngredienteId] FROM [ProductoIngrediente] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId AND [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00033,1,0,true,false )
             ,new CursorDef("T00034", "SELECT [IngredienteCosto] FROM [Ingrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00034,1,0,true,false )
             ,new CursorDef("T00035", "SELECT [ProductoId], [ProductoDescripcion], [ProductoEstado], [ProductoTipo], [ProductoReceta], [ProductoTiempoPreparacion] FROM [Producto] WITH (UPDLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00035,1,0,true,false )
             ,new CursorDef("T00036", "SELECT [ProductoId], [ProductoDescripcion], [ProductoEstado], [ProductoTipo], [ProductoReceta], [ProductoTiempoPreparacion] FROM [Producto] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00036,1,0,true,false )
             ,new CursorDef("T00038", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (UPDLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00038,1,0,true,false )
             ,new CursorDef("T000310", "SELECT TM1.[ProductoId], TM1.[ProductoDescripcion], TM1.[ProductoEstado], TM1.[ProductoTipo], TM1.[ProductoReceta], TM1.[ProductoTiempoPreparacion], COALESCE( T2.[ProductoPrecio], 0) AS ProductoPrecio FROM ([Producto] TM1 WITH (NOLOCK) LEFT JOIN (SELECT SUM(T3.[ProductoIngredienteCantidad] * CAST(T4.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T3.[ProductoId] FROM ([ProductoIngrediente] T3 WITH (NOLOCK) INNER JOIN [Ingrediente] T4 WITH (NOLOCK) ON T4.[IngredienteId] = T3.[IngredienteId]) GROUP BY T3.[ProductoId] ) T2 ON T2.[ProductoId] = TM1.[ProductoId]) WHERE TM1.[ProductoId] = @ProductoId ORDER BY TM1.[ProductoId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000310,100,0,true,false )
             ,new CursorDef("T000312", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (UPDLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000312,1,0,true,false )
             ,new CursorDef("T000313", "SELECT [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000313,1,0,true,false )
             ,new CursorDef("T000314", "SELECT TOP 1 [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE ( [ProductoId] > @ProductoId) ORDER BY [ProductoId]  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000314,1,0,true,true )
             ,new CursorDef("T000315", "SELECT TOP 1 [ProductoId] FROM [Producto] WITH (NOLOCK) WHERE ( [ProductoId] < @ProductoId) ORDER BY [ProductoId] DESC  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000315,1,0,true,true )
             ,new CursorDef("T000316", "SELECT [ProductoId], [ProductoDescripcion], [ProductoEstado], [ProductoTipo], [ProductoReceta], [ProductoTiempoPreparacion] FROM [Producto] WITH (UPDLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000316,1,0,true,false )
             ,new CursorDef("T000317", "INSERT INTO [Producto] ([ProductoId], [ProductoDescripcion], [ProductoEstado], [ProductoTipo], [ProductoReceta], [ProductoTiempoPreparacion]) VALUES (@ProductoId, @ProductoDescripcion, @ProductoEstado, @ProductoTipo, @ProductoReceta, @ProductoTiempoPreparacion)", GxErrorMask.GX_NOMASK,prmT000317)
             ,new CursorDef("T000318", "UPDATE [Producto] SET [ProductoDescripcion]=@ProductoDescripcion, [ProductoEstado]=@ProductoEstado, [ProductoTipo]=@ProductoTipo, [ProductoReceta]=@ProductoReceta, [ProductoTiempoPreparacion]=@ProductoTiempoPreparacion  WHERE [ProductoId] = @ProductoId", GxErrorMask.GX_NOMASK,prmT000318)
             ,new CursorDef("T000319", "DELETE FROM [Producto]  WHERE [ProductoId] = @ProductoId", GxErrorMask.GX_NOMASK,prmT000319)
             ,new CursorDef("T000321", "SELECT COALESCE( T1.[ProductoPrecio], 0) AS ProductoPrecio FROM (SELECT SUM(T2.[ProductoIngredienteCantidad] * CAST(T3.[IngredienteCosto] AS decimal( 10, 5))) AS ProductoPrecio, T2.[ProductoId] FROM ([ProductoIngrediente] T2 WITH (UPDLOCK) INNER JOIN [Ingrediente] T3 WITH (NOLOCK) ON T3.[IngredienteId] = T2.[IngredienteId]) GROUP BY T2.[ProductoId] ) T1 WHERE T1.[ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000321,1,0,true,false )
             ,new CursorDef("T000322", "SELECT TOP 1 [PedidoId], [PedidoLineaId] FROM [PedidoLinea] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000322,1,0,true,true )
             ,new CursorDef("T000323", "SELECT [ProductoId] FROM [Producto] WITH (NOLOCK) ORDER BY [ProductoId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000323,100,0,true,false )
             ,new CursorDef("T000324", "SELECT T1.[ProductoId], T1.[ProductoIngredienteCantidad], T2.[IngredienteCosto], T1.[IngredienteId] FROM ([ProductoIngrediente] T1 WITH (NOLOCK) INNER JOIN [Ingrediente] T2 WITH (NOLOCK) ON T2.[IngredienteId] = T1.[IngredienteId]) WHERE T1.[ProductoId] = @ProductoId and T1.[IngredienteId] = @IngredienteId ORDER BY T1.[ProductoId], T1.[IngredienteId] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000324,11,0,true,false )
             ,new CursorDef("T000325", "SELECT [IngredienteCosto] FROM [Ingrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000325,1,0,true,false )
             ,new CursorDef("T000326", "SELECT [ProductoId], [IngredienteId] FROM [ProductoIngrediente] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId AND [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000326,1,0,true,false )
             ,new CursorDef("T000327", "INSERT INTO [ProductoIngrediente] ([ProductoId], [ProductoIngredienteCantidad], [IngredienteId]) VALUES (@ProductoId, @ProductoIngredienteCantidad, @IngredienteId)", GxErrorMask.GX_NOMASK,prmT000327)
             ,new CursorDef("T000328", "UPDATE [ProductoIngrediente] SET [ProductoIngredienteCantidad]=@ProductoIngredienteCantidad  WHERE [ProductoId] = @ProductoId AND [IngredienteId] = @IngredienteId", GxErrorMask.GX_NOMASK,prmT000328)
             ,new CursorDef("T000329", "DELETE FROM [ProductoIngrediente]  WHERE [ProductoId] = @ProductoId AND [IngredienteId] = @IngredienteId", GxErrorMask.GX_NOMASK,prmT000329)
             ,new CursorDef("T000330", "SELECT [IngredienteCosto] FROM [Ingrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000330,1,0,true,false )
             ,new CursorDef("T000331", "SELECT [ProductoId], [IngredienteId] FROM [ProductoIngrediente] WITH (NOLOCK) WHERE [ProductoId] = @ProductoId ORDER BY [ProductoId], [IngredienteId] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000331,11,0,true,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((long[]) buf[2])[0] = rslt.getLong(3) ;
                break;
             case 1 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((long[]) buf[2])[0] = rslt.getLong(3) ;
                break;
             case 2 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                break;
             case 3 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((decimal[]) buf[5])[0] = rslt.getDecimal(6) ;
                break;
             case 4 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((decimal[]) buf[5])[0] = rslt.getDecimal(6) ;
                break;
             case 5 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 6 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((decimal[]) buf[5])[0] = rslt.getDecimal(6) ;
                ((decimal[]) buf[6])[0] = rslt.getDecimal(7) ;
                ((bool[]) buf[7])[0] = rslt.wasNull(7);
                break;
             case 7 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 8 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 9 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 10 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 11 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((String[]) buf[2])[0] = rslt.getString(3, 1) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((String[]) buf[4])[0] = rslt.getVarchar(5) ;
                ((decimal[]) buf[5])[0] = rslt.getDecimal(6) ;
                break;
             case 15 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                ((bool[]) buf[1])[0] = rslt.wasNull(1);
                break;
             case 16 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
             case 17 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 18 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((short[]) buf[1])[0] = rslt.getShort(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((long[]) buf[3])[0] = rslt.getLong(4) ;
                break;
             case 19 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                break;
             case 20 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
             case 24 :
                ((decimal[]) buf[0])[0] = rslt.getDecimal(1) ;
                break;
             case 25 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 1 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 2 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 3 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 4 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 5 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 6 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 7 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 8 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 9 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 10 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 11 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 12 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (decimal)parms[5]);
                break;
             case 13 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (decimal)parms[4]);
                stmt.SetParameter(6, (long)parms[5]);
                break;
             case 14 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 15 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 16 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 18 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 19 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 20 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 21 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (short)parms[1]);
                stmt.SetParameter(3, (long)parms[2]);
                break;
             case 22 :
                stmt.SetParameter(1, (short)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (long)parms[2]);
                break;
             case 23 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                break;
             case 24 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 25 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
       }
    }

 }

}
